Skip to content

Commit

Permalink
dm mpath: fix potential NULL pointer in feature arg processing
Browse files Browse the repository at this point in the history
commit 286f367 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>
  • Loading branch information
Mike Snitzer authored and Greg Kroah-Hartman committed Aug 5, 2011
1 parent b41ed9c commit eb81cf1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/md/dm-mpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -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--;
Expand Down

0 comments on commit eb81cf1

Please sign in to comment.