protonscr

belauncher program does not parse BELauncher.ini correctly

protonopen
ValveSoftware/Proton#7526 · opened 2024-02-26 by SingleInfiniteLoop · updated 2024-02-26 · 0 comments · github
SSingleInfiniteLoop 2024-02-26 github

Currently belauncher implementation appends an erroneous value to the executable command line if the BEArg= parameter in the BELauncher.ini is present and resides in the last line of the file while the file has no new line after that one. Example file is attached: BELauncher.ini.
The suggested correction for wine is as follows:

belauncher.patch
--- a/programs/belauncher/main.c	2024-02-26 05:44:56.112719254 +0300
+++ b/programs/belauncher/main.c	2024-02-26 05:46:05.426247741 +0300
@@ -58,7 +58,7 @@
         goto start_failed;
     }
 
-    configs = HeapAlloc( GetProcessHeap(), 0, launcher_cfg_size.u.LowPart);
+    configs = HeapAlloc( GetProcessHeap(), 0, launcher_cfg_size.u.LowPart + 1 );
 
     if (!ReadFile(launcher_cfg, configs, launcher_cfg_size.u.LowPart, &size, NULL) || size != launcher_cfg_size.u.LowPart)
     {
@@ -69,6 +69,7 @@
 
     CloseHandle(launcher_cfg);
 
+    configs[launcher_cfg_size.u.LowPart] = '\0';
     config = configs;
     do
     {

Nothing extracted yet.