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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b41ed9c38a
commit
eb81cf19f5
@@ -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--;
|
||||
|
||||
Reference in New Issue
Block a user