mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-12-23 03:53:43 +01:00
Fix a SIGSEGV in test-ptrace.c
./test-ptrace -v resulted in a SIGSEGV.
This commit is contained in:
parent
32202619c4
commit
707b1dba99
1 changed files with 7 additions and 0 deletions
|
@ -204,6 +204,8 @@ main (int argc, char **argv)
|
||||||
++optind, print_names = 0;
|
++optind, print_names = 0;
|
||||||
else
|
else
|
||||||
fprintf(stderr, "unrecognized option: %s\n", argv[optind++]);
|
fprintf(stderr, "unrecognized option: %s\n", argv[optind++]);
|
||||||
|
if (optind >= argc)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
target_pid = fork ();
|
target_pid = fork ();
|
||||||
|
@ -221,6 +223,11 @@ main (int argc, char **argv)
|
||||||
#else
|
#else
|
||||||
#error Trace me
|
#error Trace me
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (optind == argc) {
|
||||||
|
fprintf(stderr, "Need to specify a command line for the child\n");
|
||||||
|
exit (-1);
|
||||||
|
}
|
||||||
execve (argv[optind], argv + optind, environ);
|
execve (argv[optind], argv + optind, environ);
|
||||||
_exit (-1);
|
_exit (-1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue