From e8f97967526effd8b8c034c0975452d80c0e5c65 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Wed, 30 Oct 2024 16:33:14 +0100 Subject: Fixed a small memory invalid read with my_execv --- src/wrapped/wrappedlibc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index 8c9be048..8ca4c5b9 100644 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -2240,7 +2240,7 @@ EXPORT int32_t my_execv(x64emu_t* emu, const char* path, char* const argv[]) 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)); + memcpy(newargv+toadd, argv+skip_first, sizeof(char*)*(n+1-skip_first)); if(self) newargv[1] = emu->context->fullpath; else { -- cgit 1.4.1