mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
dmfilemapd: return error for wrong number of args
The initial check on argc incorrectly returns 1 when the wrong number of arguments are present, causing a segfault in main() when no arguments are given: # dmfilemapd Wrong number of arguments. usage: dmfilemapd <fd> <group_id> <path> <mode> [<foreground>[<log_level>]] Segmentation fault (core dumped)
This commit is contained in:
parent
66760f9673
commit
9b0aba5fe9
@ -255,7 +255,7 @@ static int _parse_args(int argc, char **argv, struct filemap_monitor *fm)
|
||||
if (argc < 5) {
|
||||
_early_log("Wrong number of arguments.");
|
||||
_early_log("usage: %s", _usage);
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
memset(fm, 0, sizeof(*fm));
|
||||
|
Loading…
Reference in New Issue
Block a user