https://bugs.winehq.org/show_bug.cgi?id=57830
Bug ID: 57830 Summary: StarCitizen fails to launch Product: Wine Version: 10.1 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: rawfox@freenet.de Distribution: ---
Created attachment 78038 --> https://bugs.winehq.org/attachment.cgi?id=78038 fix-off-by-one-mistake.patch
StarCitizen does not launch due to a mistake in the file dlls/wbemprox/builtin.c
if (++i > nb_allocated)
Netho (ngh) from Linux Users Group (#LUG) found it and quick hacked a diff, thanks you man ! He said, this will be true when `i` was 16. Due to C is 0 indexed it means it just wrote past the buffer, clobbering something critical. Changing it to >= does the trick.
if (++i >= nb_allocated) this made it work again.
Cheers, raw^^
https://bugs.winehq.org/show_bug.cgi?id=57830
--- Comment #1 from Rafał Mużyło galtgendo@o2.pl --- ...after a few (dozen) iterations, I finally got that patch: it's correct due to awkward order of assignment/allocation: at the point it's allocated we don't know yet *if* there will be another item to assign, so we must allocate one more than it seems necessary, so we don't assign past the limit if we *do* get that item in the next loop. Bit tricky due to that order (and we might end up not needing any of the extra memory).
https://bugs.winehq.org/show_bug.cgi?id=57830
--- Comment #2 from Rafał Mużyło galtgendo@o2.pl --- To bug author: you might consider to CC author of the relevant commit (33756286).
https://bugs.winehq.org/show_bug.cgi?id=57830
Bernhard Übelacker bernhardu@mailbox.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |bernhardu@mailbox.org
--- Comment #3 from Bernhard Übelacker bernhardu@mailbox.org --- (In reply to rawfox from comment #0) ...
dlls/wbemprox/builtin.c
if (++i > nb_allocated)
...
This line showed up independently in some ASan tests and following got committed: https://gitlab.winehq.org/wine/wine/-/commit/fe4ed10ea18b064ed1431fbec5f36aa...
Probably you want to test this again, either with a self built Wine from latest git or by the next Wine version 10.2, possibly released next friday.
https://bugs.winehq.org/show_bug.cgi?id=57830
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |wmi&wbemprox Status|UNCONFIRMED |RESOLVED Resolution|--- |DUPLICATE
--- Comment #4 from Nikolay Sivov bunglehead@gmail.com --- Marking as a duplicate.
*** This bug has been marked as a duplicate of bug 57803 ***
https://bugs.winehq.org/show_bug.cgi?id=57830
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #5 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Closing duplicate.