diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2022-06-26 18:21:04 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2022-06-26 18:21:04 +0200 |
| commit | 83925633e015ced8e8629af43faa2767c0fd7ddf (patch) | |
| tree | 3bb997a096169c16ad04aedcaa6975a641e22b85 /src | |
| parent | 42943eab954514e3bd53046140e9ea4cdb6e3577 (diff) | |
| download | box64-83925633e015ced8e8629af43faa2767c0fd7ddf.tar.gz box64-83925633e015ced8e8629af43faa2767c0fd7ddf.zip | |
Fixed some potential issue for eroneous execv call (fixes some infinite looping AppImage)
Diffstat (limited to 'src')
| -rwxr-xr-x | src/wrapped/wrappedlibc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index a5f41035..8ca9bcf3 100755 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -1674,7 +1674,7 @@ EXPORT int32_t my_execv(x64emu_t* emu, const char* path, char* const argv[]) int self = isProcSelf(path, "exe"); int x64 = FileIsX64ELF(path); int x86 = my_context->box86path?FileIsX86ELF(path):0; - printf_log(LOG_DEBUG, "execv(\"%s\", %p) is x64=%d x86=%d\n", path, argv, x64, x86); + printf_log(LOG_DEBUG, "execv(\"%s\", %p) is x64=%d x86=%d self=%d\n", path, argv, x64, x86, self); #if 1 if (x64 || x86 || self) { int skip_first = 0; @@ -1686,7 +1686,7 @@ EXPORT int32_t my_execv(x64emu_t* emu, const char* path, char* const argv[]) const char** newargv = (const char**)calloc(n+2, sizeof(char*)); newargv[0] = x86?emu->context->box86path:emu->context->box64path; memcpy(newargv+1, argv+skip_first, sizeof(char*)*(n+1)); - if(self) newargv[1] = emu->context->fullpath; + if(self) newargv[1] = emu->context->fullpath; else newargv[1] = path; printf_log(LOG_DEBUG, " => execv(\"%s\", %p [\"%s\", \"%s\", \"%s\"...:%d])\n", newargv[0], newargv, newargv[0], n?newargv[1]:"", (n>1)?newargv[2]:"",n); int ret = execv(newargv[0], (char* const*)newargv); free(newargv); |