[Bug 37848] New: For loop %~$PATH:I feature works incorrect - PATH variable size limited by MAX_PATH
https://bugs.winehq.org/show_bug.cgi?id=37848 Bug ID: 37848 Summary: For loop %~$PATH:I feature works incorrect - PATH variable size limited by MAX_PATH Product: Wine Version: 1.7.33 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: cmd Assignee: wine-bugs(a)winehq.org Reporter: ho-rr-or(a)mail.ru Distribution: --- Created attachment 50409 --> https://bugs.winehq.org/attachment.cgi?id=50409 Batch file for reproduce For loop has %~$PATH:I syntax for search file in path list from PATH variable, but it is not works when PATH variable size more then MAX_PATH. Seems like there are invalid code in batch.c: WCHAR fullpath[MAX_PATH]; // ... /* If env var not found, return empty string */ if ((GetEnvironmentVariableW(env, fullpath, MAX_PATH) == 0) || (SearchPathW(fullpath, outputparam, NULL, MAX_PATH, outputparam, NULL) == 0)) { finaloutput[0] = 0x00; outputparam[0] = 0x00; skipFileParsing = TRUE; } Actually PATH length can be greater then MAX_PATH, so it is wrong behavior. Size of fullpath should be based on variable size. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=37848 Mikhail Bystryantsev <ho-rr-or(a)mail.ru> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ho-rr-or(a)mail.ru -- 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.
https://bugs.winehq.org/show_bug.cgi?id=37848 --- Comment #1 from Mikhail Bystryantsev <ho-rr-or(a)mail.ru> --- Created attachment 50411 --> https://bugs.winehq.org/attachment.cgi?id=50411 Possible solution patch There is possible solution (alternative is using heap allocation) -- 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.
https://bugs.winehq.org/show_bug.cgi?id=37848 Bruno Jesus <00cpxxx(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #2 from Bruno Jesus <00cpxxx(a)gmail.com> --- Confirming, I just sent a patch: http://source.winehq.org/patches/data/108483 -- 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.
https://bugs.winehq.org/show_bug.cgi?id=37848 Bruno Jesus <00cpxxx(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |5a469f1b87e58fd96dfb68f1e89 | |2c0d3cae5a97b Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #3 from Bruno Jesus <00cpxxx(a)gmail.com> --- Fixed by http://source.winehq.org/git/wine.git/?a=commit;h=5a469f1b87e58fd96dfb68f1e8... Thanks for the report. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=37848 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #4 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 1.7.34. -- 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.
participants (1)
-
wine-bugs@winehq.org