]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
dm mpath: fix potential NULL pointer in feature arg processing
authorMike Snitzer <snitzer@redhat.com>
Tue, 2 Aug 2011 11:32:00 +0000 (12:32 +0100)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Thu, 17 May 2012 15:21:25 +0000 (11:21 -0400)
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: Paul Gortmaker <paul.gortmaker@windriver.com>
drivers/md/dm-mpath.c

index ed1d0c23c802d18ebc3ec40aaabded361be72135..78090ebaba6cdd6b84898b8c8d2833b7d0521909 100644 (file)
@@ -793,6 +793,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--;