From 36945ddbf7106fc692533ec145eaf124d68600ad Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sun, 25 Jun 2023 22:27:05 +0200 Subject: user/testelf: fix broken path in stackexec --- src/user/app/testelf/main.c | 7 ++++--- 1 file 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 #include #include #include @@ -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; } -- cgit v1.2.3