mirror of
https://github.com/ptitSeb/box86.git
synced 2024-11-23 14:50:29 +00:00
Fixed some potential segfault with wine apps (maybe others too)
This commit is contained in:
parent
ca1f0d0cf2
commit
e02844fb93
@ -1774,7 +1774,8 @@ EXPORT int32_t my_open(x86emu_t* emu, void* pathname, int32_t flags, uint32_t mo
|
||||
int dummy = write(tmp, emu->context->fullpath, strlen(emu->context->fullpath)+1);
|
||||
(void)dummy;
|
||||
for (int i=1; i<emu->context->argc; ++i)
|
||||
dummy = write(tmp, emu->context->argv[i], strlen(emu->context->argv[i])+1);
|
||||
if(emu->context->argv[i])
|
||||
dummy = write(tmp, emu->context->argv[i], strlen(emu->context->argv[i])+1);
|
||||
lseek(tmp, 0, SEEK_SET);
|
||||
#endif
|
||||
return tmp;
|
||||
@ -1862,7 +1863,8 @@ EXPORT int32_t my_open64(x86emu_t* emu, void* pathname, int32_t flags, uint32_t
|
||||
int dummy = write(tmp, emu->context->fullpath, strlen(emu->context->fullpath)+1);
|
||||
(void)dummy;
|
||||
for (int i=1; i<emu->context->argc; ++i)
|
||||
dummy = write(tmp, emu->context->argv[i], strlen(emu->context->argv[i])+1);
|
||||
if(emu->context->argv[i]) //can be NULL when wine re-adjust the args
|
||||
dummy = write(tmp, emu->context->argv[i], strlen(emu->context->argv[i])+1);
|
||||
lseek(tmp, 0, SEEK_SET);
|
||||
#endif
|
||||
return tmp;
|
||||
|
Loading…
Reference in New Issue
Block a user