1
0
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:
Bryn M. Reeves 2017-03-13 11:09:11 +00:00
parent 66760f9673
commit 9b0aba5fe9

View File

@ -255,7 +255,7 @@ static int _parse_args(int argc, char **argv, struct filemap_monitor *fm)
if (argc < 5) { if (argc < 5) {
_early_log("Wrong number of arguments."); _early_log("Wrong number of arguments.");
_early_log("usage: %s", _usage); _early_log("usage: %s", _usage);
return 1; return 0;
} }
memset(fm, 0, sizeof(*fm)); memset(fm, 0, sizeof(*fm));