advpack: Fix buffer sizes for possibly quoted strings (try 2, including testcase)
wine at mkarcher.dialup.fu-berlin.de
Thu May 29 09:20:42 CDT 2008
Increase buffer size to make quoted strings fit. This fixes the problem
Dan described in
is caused by quoted 'HKLM' not fitting into prefix. This patch does, on
request, *not* fix the bigger picture issue that made it possible for
this bug to slip for such a long time, which is missing error checking
on SetupGetStringFieldW calls in get_dest_dir. Valid .inf files should,
of course, not exercise the missing error check, so on valid .inf
files, this patch is sufficient for correct behaviour.
In the testcase with quoted 'HKLM', SetupGetStringFieldW fails because
of unsufficient buffer size, which is *ignore* by the current code. As
from the previous destination parsed in the patch the local automatic
variable still contains the unquoted HKLM and by luck does not get
overwritten between invocations of get_dest_dir, the testcase passes
nevertheless except if compiled by gutsy's gcc 4.1 without optimization
which puts the local variable to a stack location that does not survive
between different invocations of get_dest_dir.
The attached change to the testcase "pollutes" the local variable prefix
with HKCU, so the bug is always exposed and not just by bad luck.
dlls/advpack/advpack.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1276 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20080529/4ea017e8/attachment-0001.bin
More information about the wine-patches