Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2011-08-02 12:32:00 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-08 10:23:21 -0700
commitc72ff34c937a4572946fdcd79ecbff2fe81f7654 (patch)
tree3c40ceeadc097dc39210e442138d4d726921acf2
parent67b0a8421ec7737f20db9f2ab150445a897f138a (diff)
dm mpath: fix potential NULL pointer in feature arg processing
commit 286f367dad40beb3234a18c17391d03ba939a7f3 upstream. Avoid dereferencing a NULL pointer if the number of feature arguments supplied is fewer than indicated. Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/md/dm-mpath.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index fcf717cb2684..b03cd3971830 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -778,6 +778,11 @@ static int parse_features(struct arg_set *as, struct multipath *m)
if (!argc)
return 0;
+ if (argc > as->argc) {
+ ti->error = "not enough arguments for features";
+ return -EINVAL;
+ }
+
do {
param_name = shift(as);
argc--;