Re: Resent^2 : Zero out return string in GetMenuStr
Uwe Bonnes <bon(a)elektron.ikp.physik.tu-darmstadt.de> writes:
Anything wrong with this patch?
Changelog: dlls/user/menu.c: GetMenuStrA|W Initialize return string as an empty string
You need to take the specified length into account before writing to the string. -- Alexandre Julliard julliard(a)winehq.org
"Alexandre" == Alexandre Julliard <julliard(a)winehq.org> writes:
Alexandre> Uwe Bonnes <bon(a)elektron.ikp.physik.tu-darmstadt.de> writes: >> Anything wrong with this patch? >> >> Changelog: dlls/user/menu.c: GetMenuStrA|W Initialize return string >> as an empty string Alexandre> You need to take the specified length into account before Alexandre> writing to the string. Alexandre, also before, there was a NULL written to position Zero of the string. However there where some checks and function calls that could return Zero but didn't touch the string. Now there is only a check that the argument is a pointer before the Null is written. What should be done in another way? -- Uwe Bonnes bon(a)elektron.ikp.physik.tu-darmstadt.de Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Uwe Bonnes <bon(a)elektron.ikp.physik.tu-darmstadt.de> writes:
Alexandre,
also before, there was a NULL written to position Zero of the string. However there where some checks and function calls that could return Zero but didn't touch the string. Now there is only a check that the argument is a pointer before the Null is written. What should be done in another way?
The existing code checks nMaxSiz before writing, you should do the same. -- Alexandre Julliard julliard(a)winehq.org
participants (2)
-
Alexandre Julliard -
Uwe Bonnes