[Bug 48486] New: cmd WCMD_ReadAndParseLine contains non-null terminated strings, causing garbage output in trace logs

WineHQ Bugzilla wine-bugs at winehq.org
Sun Jan 19 13:57:09 CST 2020


https://bugs.winehq.org/show_bug.cgi?id=48486

            Bug ID: 48486
           Summary: cmd WCMD_ReadAndParseLine contains non-null terminated
                    strings, causing garbage output in trace logs
           Product: Wine
           Version: 5.0-rc6
          Hardware: x86
                OS: Linux
            Status: NEW
          Severity: trivial
          Priority: P2
         Component: cmd
          Assignee: wine-bugs at winehq.org
          Reporter: focht at gmx.net
      Distribution: ---

Hello folks,

as it says. It's already PE but various strings have not been converted yet.
The function in the summary is the one most offending/annoying in trace logs.
There are other occurrences as well.

Example download: 

https://github.com/git-for-windows/git/releases/download/v2.25.0.windows.1/Git-2.25.0-32-bit.exe

--- snip ---
...
006a:Call KERNEL32.MultiByteToWideChar(000001b5,00000000,00bd7a78 "\t\t at IF NOT
EXIST bin\\rebase.exe @(\n\t\t\t at IF NOT EXIST bin @MKDIR bin\n\t\t\t at COPY
usr\\bin\\rebase.exe bin\\rebase.exe\n\t\t)\n\t\t at IF NOT EXIST
bin\\msys-2.0.dll @(\n\t\t\t at COPY usr\\bin\\msys-2.0.dll
bin\\msys-2.0.dll\n\t\t)\n\t\t at bin\\rebase.exe -b 0x64000000
usr\\bin\\msys-2.0.dll\n"...,00000021,00be5238,00002000) ret=00401a09
006a:Ret  KERNEL32.MultiByteToWideChar() retval=00000021 ret=00401a09
006a:Call KERNEL32.HeapFree(00110000,00000000,00bd7a78) ret=00401a22
006a:Ret  KERNEL32.HeapFree() retval=00000001 ret=00401a22
006a:Call msvcrt.wcschr(00be523c L"@IF NOT EXIST bin\\rebase.exe @(",00000025)
ret=004137f3
006a:Ret  msvcrt.wcschr() retval=00000000 ret=004137f3
006a:Call KERNEL32.CompareStringW(00000400,00001001,00be523e L"IF NOT EXIST
bin\\rebase.exe @(",00000003,0041b706
L"remforifelse\4357\444d\525f\6165\4164\646e\6150\7372\4c65\6e69e\6f4e\6320\6d6f\616d\646e\6e20\726f\6820\6e61\6c64\2065\7573\7070\696c\6465\necho.echo:echo/\764f\7265\6c66\776f\6420\7465\6365\6574\2064\6e69\6320\6d6f\616d\646e\ndo/I",00000003)
ret=00411489
006a:Ret  KERNEL32.CompareStringW() retval=00000001 ret=00411489
006a:Call KERNEL32.CompareStringW(00000400,00001001,00be523e L"IF NOT EXIST
bin\\rebase.exe @(",00000003,0041b70c
L"forifelse\4357\444d\525f\6165\4164\646e\6150\7372\4c65\6e69e\6f4e\6320\6d6f\616d\646e\6e20\726f\6820\6e61\6c64\2065\7573\7070\696c\6465\necho.echo:echo/\764f\7265\6c66\776f\6420\7465\6365\6574\2064\6e69\6320\6d6f\616d\646e\ndo/I",00000003)
ret=004115c0
006a:Ret  KERNEL32.CompareStringW() retval=00000003 ret=004115c0
006a:Call KERNEL32.CompareStringW(00000400,00001001,00be523e L"IF NOT EXIST
bin\\rebase.exe @(",00000002,0041b712
L"ifelse\4357\444d\525f\6165\4164\646e\6150\7372\4c65\6e69e\6f4e\6320\6d6f\616d\646e\6e20\726f\6820\6e61\6c64\2065\7573\7070\696c\6465\necho.echo:echo/\764f\7265\6c66\776f\6420\7465\6365\6574\2064\6e69\6320\6d6f\616d\646e\ndo/I",00000002)
ret=004115fa
006a:Ret  KERNEL32.CompareStringW() retval=00000002 ret=004115fa 
...
--- snip ---

Wine source:

https://source.winehq.org/git/wine.git/blob/02f3a133b64ed1f979309e1399738eaa2e204651:/programs/cmd/wcmdmain.c#l1816

$ sha1sum Git-2.25.0-32-bit.exe 
7dc64019c089d4a9a3700ee7140a7af9a5416199  Git-2.25.0-32-bit.exe

$ du -sh Git-2.25.0-32-bit.exe 
45M    Git-2.25.0-32-bit.exe

$ wine --version
wine-5.0-rc6

Regards

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


More information about the wine-bugs mailing list