dm mpath: fix potential NULL pointer in feature arg processing

Avoid dereferencing a NULL pointer if the number of feature arguments
supplied is fewer than indicated.

Signed-off-by: Mike Snitzer <[email protected]>
Signed-off-by: Alasdair G Kergon <[email protected]>
Cc: [email protected]
This commit is contained in:
Mike Snitzer 2011-08-02 12:32:00 +01:00 • committed by Alasdair G Kergon
commit 286f367dad

View 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--;