about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-06-10 09:28:38 +0200
committerptitSeb <sebastien.chev@gmail.com>2023-06-10 09:28:38 +0200
commit1d584fead4e5df89d62f17521e17de21f81342c8 (patch)
treedf71e324cb5e04cdfe36e33b32bfa8df980af45b
parentcc56ebbb35242cd41322dda98b629b2f044c3207 (diff)
downloadbox64-1d584fead4e5df89d62f17521e17de21f81342c8.tar.gz
box64-1d584fead4e5df89d62f17521e17de21f81342c8.zip
Fixed an issue in wrapped execv
-rwxr-xr-xsrc/wrapped/wrappedlibc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index d0792d3c..af756f79 100755
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -1887,7 +1887,7 @@ EXPORT int32_t my_execv(x64emu_t* emu, const char* path, char* const argv[])
         int n=skip_first;
         while(argv[n]) ++n;
         int toadd = script?2:1;
-        const char** newargv = (const char**)box_calloc(n+toadd+1, sizeof(char*));
+        const char** newargv = (const char**)box_calloc(n+toadd+2, sizeof(char*));
         newargv[0] = x86?emu->context->box86path:emu->context->box64path;
         if(script) newargv[1] = emu->context->bashpath; // script needs to be launched with bash
         memcpy(newargv+toadd, argv+skip_first, sizeof(char*)*(n+toadd));