Skip to content

Fix crash with incorrect argv[0]: rewrite it only if "box86" is present#1020

Merged
ptitSeb merged 1 commit intoptitSeb:masterfrom
ValdikSS:fix-argv0-crash
Jan 4, 2025
Merged

Fix crash with incorrect argv[0]: rewrite it only if "box86" is present#1020
ptitSeb merged 1 commit intoptitSeb:masterfrom
ValdikSS:fix-argv0-crash

Conversation

@ValdikSS
Copy link
Contributor

@ValdikSS ValdikSS commented Jan 4, 2025

This resolves funny crash if there's no '8' in argv[0].

@ValdikSS
Copy link
Contributor Author

ValdikSS commented Jan 4, 2025

The same issue in box64:

my_context->box86path = box_strdup(my_context->box64path);
#ifndef BOX32
char* p = strrchr(my_context->box86path, '6');  // get the 6 of box64
p[0] = '8'; p[1] = '6'; // change 64 to 86

https://github.com/ptitSeb/box64/blob/5fa65a4b38c1a449af3703a3f760eb09bc9dbca8/src/core.c#L2143-L2146

@ptitSeb ptitSeb merged commit d940221 into ptitSeb:master Jan 4, 2025
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants