summaryrefslogtreecommitdiff
path: root/libmultipath/structs_vec.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2008-11-24 08:31:28 +0100
committerChristophe Varoqui <christophe.varoqui@free.fr>2009-04-22 00:48:12 +0200
commit5dc885f2b4172dacda6245fddcc1fc9a0591cc25 (patch)
tree70c2c84de5fbea56fa5407dfdb2adee094022b01 /libmultipath/structs_vec.c
parented5f5a7a49e1efb452255ff114a27ec5169fa6a2 (diff)
downloadmultipath-tools-5dc885f2b4172dacda6245fddcc1fc9a0591cc25.tar.gz
multipath-tools-5dc885f2b4172dacda6245fddcc1fc9a0591cc25.tar.bz2
multipath-tools-5dc885f2b4172dacda6245fddcc1fc9a0591cc25.zip
Check vector_foreach_slot for NULL argument
Most crashes are due to vector_foreach_slot not checking for NULL argument. Do that now, and add some more checks for not accessing a NULL pointer indirection. Signed-off-by: Hannes Reinecke <hare@suse.de>
Diffstat (limited to 'libmultipath/structs_vec.c')
-rw-r--r--libmultipath/structs_vec.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c
index e27827c..c670b3f 100644
--- a/libmultipath/structs_vec.c
+++ b/libmultipath/structs_vec.c
@@ -163,7 +163,7 @@ _remove_maps (struct vectors * vecs, int stop_waiter)
int i;
struct multipath * mpp;
- if (!vecs->mpvec)
+ if (!vecs)
return;
vector_foreach_slot (vecs->mpvec, mpp, i) {
@@ -443,7 +443,7 @@ verify_paths(struct multipath * mpp, struct vectors * vecs, vector rpvec)
int count = 0;
int i, j;
- if (!mpp->paths)
+ if (!mpp)
return 0;
vector_foreach_slot (mpp->paths, pp, i) {
@@ -491,9 +491,6 @@ int update_multipath (struct vectors *vecs, char *mapname)
if (setup_multipath(vecs, mpp))
return 1; /* mpp freed in setup_multipath */
- if (!mpp->pg)
- return 0; /* Can happen when all paths are down */
-
/*
* compare checkers states with DM states
*/