Fix faudit syscall bug and crash when single argument was passed

This commit is contained in:
Reiner Herrmann 2017-06-15 15:43:59 +02:00
parent 48deec9580
commit cde35acef2
2 changed files with 4 additions and 1 deletions

View file

@ -38,7 +38,7 @@ int main(int argc, char **argv) {
int i;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "syscall")) {
if (strcmp(argv[i], "syscall") == 0) {
syscall_helper(argc, argv);
return 0;
}

View file

@ -34,6 +34,9 @@ extern int pivot_root(const char *new_root, const char *put_old);
void syscall_helper(int argc, char **argv) {
(void) argc;
if (argc < 3)
return;
if (strcmp(argv[2], "mount") == 0) {
int rv = mount(NULL, NULL, NULL, 0, NULL);
(void) rv;