$ ./setarch
Segmentation fault (core dumped)
$ coredumpctl gdb
...
Program terminated with signal SIGSEGV, Segmentation fault.
301 if (*argv[1] != '-') {
Reference:
5edb0ea6bbd57dd916417737f98c9109dc1ecb5b
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
if (archwrapper)
arch = program_invocation_short_name; /* symlinks to setarch */
else {
if (archwrapper)
arch = program_invocation_short_name; /* symlinks to setarch */
else {
+ if (1 < argc && *argv[1] != '-') {
arch = argv[1];
argv[1] = argv[0]; /* for getopt_long() to get the program name */
argv++;
arch = argv[1];
argv[1] = argv[0]; /* for getopt_long() to get the program name */
argv++;