Commit 9b23e5ee authored by Sebastien Gougeaud's avatar Sebastien Gougeaud Committed by Thomas Leibovici
Browse files

fix: segfault when using phobosd with a wrong option



A segmentation fault error occurs if a bad option is given to phobosd.
To correct it, the long_options array needs to be terminated with a
0-filled structure.

Change-Id: I22889af5a7eedde85dce6ca344cb828afe8032ee
Signed-off-by: default avatarSebastien Gougeaud <sebastien.gougeaud@cea.fr>
Reviewed-on: https://cws-fleury.labs.ocre.cea.fr/gerrit/6509


Reviewed-by: Linter
Tested-by: default avatarJenkins s8open_nr <s8open_nr@ccc.ocre.cea.fr>
Reviewed-by: default avatarQuentin Bouget <quentin.bouget@cea.fr>
Reviewed-by: default avatarThomas Leibovici <thomas.leibovici@cea.fr>
parent 989076cc
......@@ -353,7 +353,8 @@ static struct lrs_params parse_args(int argc, char **argv)
{"config", required_argument, 0, 'c'},
{"verbose", no_argument, 0, 'v'},
{"quiet", no_argument, 0, 'q'},
{"syslog", no_argument, 0, 's'}
{"syslog", no_argument, 0, 's'},
{0, 0, 0, 0}
};
struct lrs_params parm = LRS_PARAMS_DEFAULT;
......@@ -379,6 +380,9 @@ static struct lrs_params parse_args(int argc, char **argv)
break;
case 's':
parm.use_syslog = true;
break;
default:
exit(EXIT_FAILURE);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment