cabinet: FCICreate: initialize oldCCAB
dank at kegel.com
Sun Nov 4 08:26:06 CST 2007
[me not being lazy, part 2 of 2]
The cabinet code is a bit twisty, but from what I can gather,
FCICreate takes a CCAB from the user, and if during
FCIAddFile it finds the cabfile is getting too big,
it saves the old CCAB and creates a new one.
FCIFlushCabinet checks some fields of
the old CCAB to see if they're zero or not.
Problem is, the old CCAB was left uninitialized
until that first overflow. Although I don't understand the
twisty code, initializing the old CCAB to zero in FCICreate feels right.
Found via this valgrind warning:
Conditional jump or move depends on uninitialised value(s)
at 0x4605882: fci_flush_folder (fci.c:497)
by 0x4606CC1: fci_flush_cabinet (fci.c:1540)
by 0x460873F: FCIFlushCabinet (fci.c:2790)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 466 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20071104/7a79d262/attachment.patch
More information about the wine-patches