]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Avoid dereferencing a NULL pointer if the number of feature arguments
authorMike Snitzer <snitzer@redhat.com>
Mon, 25 Jul 2011 00:49:50 +0000 (10:49 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 25 Jul 2011 00:49:50 +0000 (10:49 +1000)
supplied is fewer than indicated.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Cc: stable@kernel.org
drivers/md/dm-mpath.c

index aa4e570c2cb5007cde5de16b9be07c001d980d68..209991bebd30d51f6b9d82476eabb96b5945c157 100644 (file)
@@ -807,6 +807,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--;