gdi32: GdiConvertToDevmodeW should not refer to unintialized name bytes (try 2)

Dan Kegel dank at kegel.com
Fri Jun 13 15:25:03 CDT 2008


As suggested by Dmitry, GdiConvertToDevmodeW should only
convert the parts of dmDeviceName up until the nul;
anything after is undefined.
Ditto for dmFormName, and also don't convert dmFormName at
all unless DM_FORMNAME is set in dmFields to indicate that
it's valid.

Fixes 32 warnings like

 Use of uninitialised value of size 4
    at  mbstowcs_sbcs (mbtowc.c:78)
    by  wine_cp_mbstowcs (mbtowc.c:266)
    by  MultiByteToWideChar (locale.c:1846)
    by  GdiConvertToDevmodeW (driver.c:434)
    by  ChangeDisplaySettingsExA (sysparams.c:3011)
    by  ChangeDisplaySettingsA (sysparams.c:2980)
    by  test_ChangeDisplaySettingsEx (monitor.c:161)
  Uninitialised value was created by a stack allocation
    at  test_ChangeDisplaySettingsEx (monitor.c:141)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gdi32-driver.patch
Type: text/x-patch
Size: 1254 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20080613/a38a957c/attachment.bin 


More information about the wine-patches mailing list