http://bugs.winehq.org/show_bug.cgi?id=20334
Summary: SysReAllocStringLen should return null terminated strings Product: Wine Version: 1.1.31 Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: oleaut32 AssignedTo: wine-bugs@winehq.org ReportedBy: al.kochet@gmail.com
Created an attachment (id=24050) --> (http://bugs.winehq.org/attachment.cgi?id=24050) wine log +seh,+tid,+relay
The call like SysReAllocStringLen (&buffer, NULL, EXPECTED_LEN) should return null terminated strings.
I found that problem, then playing with Texas Instruments Code Composer Studio v3.3 under wine.
Test and logs are attached.
http://bugs.winehq.org/show_bug.cgi?id=20334
--- Comment #1 from A. Kochetkov al.kochet@gmail.com 2009-10-12 08:56:48 --- Created an attachment (id=24051) --> (http://bugs.winehq.org/attachment.cgi?id=24051) The patch
http://bugs.winehq.org/show_bug.cgi?id=20334
--- Comment #2 from A. Kochetkov al.kochet@gmail.com 2009-10-12 08:59:24 --- Created an attachment (id=24052) --> (http://bugs.winehq.org/attachment.cgi?id=24052) The test programm
http://bugs.winehq.org/show_bug.cgi?id=20334
--- Comment #3 from Nikolay Sivov bunglehead@gmail.com 2009-10-12 09:07:40 --- Hi, thanks for report.
Could you provide a test diff for Wine test suite (oleaut32/tests/vartype.c)? It's too complicated now, all you need to check is does it add null terminator and how it depends on previous string length.
http://bugs.winehq.org/show_bug.cgi?id=20334
--- Comment #4 from A. Kochetkov al.kochet@gmail.com 2009-10-12 11:34:21 --- Created an attachment (id=24053) --> (http://bugs.winehq.org/attachment.cgi?id=24053) test diff
http://bugs.winehq.org/show_bug.cgi?id=20334
--- Comment #5 from Austin English austinenglish@gmail.com 2009-10-12 13:05:51 --- Excellent work. Please submit the test/patch to wine-patches@winehq.org
http://bugs.winehq.org/show_bug.cgi?id=20334
--- Comment #6 from Nikolay Sivov bunglehead@gmail.com 2009-10-12 13:09:24 --- (In reply to comment #4)
Created an attachment (id=24053)
--> (http://bugs.winehq.org/attachment.cgi?id=24053) [details]
test diff
(In reply to comment #5)
Excellent work. Please submit the test/patch to wine-patches@winehq.org
A small comment here. Could you reduce the buffer size? Or allocating 8K really means something?
http://bugs.winehq.org/show_bug.cgi?id=20334
--- Comment #7 from Juan Lang juan_lang@yahoo.com 2009-10-12 17:08:10 --- (In reply to comment #4)
Created an attachment (id=24053)
--> (http://bugs.winehq.org/attachment.cgi?id=24053) [details]
test diff
One further small comment: any tests that currently fail on wine need to be preceded with todo_wine.
http://bugs.winehq.org/show_bug.cgi?id=20334
A. Kochetkov al.kochet@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #24051|0 |1 is obsolete| | Attachment #24053|0 |1 is obsolete| |
--- Comment #8 from A. Kochetkov al.kochet@gmail.com 2009-10-13 03:54:28 --- Created an attachment (id=24070) --> (http://bugs.winehq.org/attachment.cgi?id=24070) New version of patch
http://bugs.winehq.org/show_bug.cgi?id=20334
--- Comment #9 from A. Kochetkov al.kochet@gmail.com 2009-10-13 03:55:09 --- (In reply to comment #6)
A small comment here. Could you reduce the buffer size? Or allocating 8K really means something?
It doen't means something for wine, but under XP with 95, 98, Me compatability mode, new allocated string is outside of previous if CHUNK_SIZE is less than 16384. Range test fails, so I cannot assert is null terminator always present. But, with 16394, range test pass, new string allocated on the old string with trash, and new string is null terminated.
(In reply to comment #7)
One further small comment: any tests that currently fail on wine need to be preceded with todo_wine.
I provide bug fix and test. Test with bug fix doesn't fail. Should I add todo_wine?
Please review another version of patch.
http://bugs.winehq.org/show_bug.cgi?id=20334
--- Comment #10 from Nikolay Sivov bunglehead@gmail.com 2009-10-13 04:25:01 --- (In reply to comment #9)
(In reply to comment #6)
A small comment here. Could you reduce the buffer size? Or allocating 8K really means something?
It doen't means something for wine, but under XP with 95, 98, Me compatability mode, new allocated string is outside of previous if CHUNK_SIZE is less than 16384. Range test fails, so I cannot assert is null terminator always present. But, with 16394, range test pass, new string allocated on the old string with trash, and new string is null terminated.
Didn't know that, if it will fail on native you should use required 8K size of course.
(In reply to comment #7)
One further small comment: any tests that currently fail on wine need to be preceded with todo_wine.
I provide bug fix and test. Test with bug fix doesn't fail. Should I add todo_wine?
Of course not, patch shouldn't bring new failures including success inside todo_wine.
Please review another version of patch.
Send it to wine-patches for review.
http://bugs.winehq.org/show_bug.cgi?id=20334
--- Comment #11 from A. Kochetkov al.kochet@gmail.com 2009-10-13 05:20:00 --- The patch was sended to wine-patches@winehq.org. Nikolay Sivov, Austin English, Juan Lang thanks a lot for your help.
http://bugs.winehq.org/show_bug.cgi?id=20334
A. Kochetkov al.kochet@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #12 from A. Kochetkov al.kochet@gmail.com 2009-10-14 10:13:55 --- Fixed, in commits: http://source.winehq.org/git/wine.git/?a=commit;h=ae4de9d6956a18b2e8bff0cfd2... http://source.winehq.org/git/wine.git/?a=commit;h=b6da072551cf6eb88d1500df51...
http://bugs.winehq.org/show_bug.cgi?id=20334
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #13 from Alexandre Julliard julliard@winehq.org 2009-10-23 13:19:35 --- Closing bugs fixed in 1.1.32.