diff options
author | dzwdz | 2023-06-25 22:27:05 +0200 |
---|---|---|
committer | dzwdz | 2023-06-25 22:27:05 +0200 |
commit | 36945ddbf7106fc692533ec145eaf124d68600ad (patch) | |
tree | c04c064e7dbc1cc4d5842fe2a00fa54a502e89d5 /src/user/app/testelf | |
parent | d4542c336a6cbfb43497055f19a85e7713f2eed7 (diff) |
user/testelf: fix broken path in stackexec
Diffstat (limited to 'src/user/app/testelf')
-rw-r--r-- | src/user/app/testelf/main.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/user/app/testelf/main.c b/src/user/app/testelf/main.c index a2e5932..0cbe56c 100644 --- a/src/user/app/testelf/main.c +++ b/src/user/app/testelf/main.c @@ -1,3 +1,4 @@ +#include <err.h> #include <stdio.h> #include <string.h> #include <unistd.h> @@ -16,10 +17,10 @@ int main(int argc, char **argv) { "I hope I won't get corrupted.\0"; char s[sizeof(s_d)]; memcpy(s, s_d, sizeof(s_d)); - const char *argv2[] = {argv[0], s, s, "hello", s, s, s, "lol", NULL}; + const char *argv2[] = {"/bin/testelf", s, s, "hello", s, s, s, "lol", NULL}; printf("argv2 == %p, s == %p\n== exec ==\n", argv2, s); - execv(argv[0], (void*)argv2); - puts("stackexec failed"); + execv((void*)argv2[0], (void*)argv2); + err(1, "execv"); } return 0; } |