[PATCH 1/2] ntdll: Fix the use of oldSize in RtlReAllocateHeap as both the size of the old block and the number of bytes used in the old block.

Robert Shearman rob at codeweavers.com
Wed Feb 20 06:56:59 CST 2008


These aren't equal if the number of bytes allocated isn't exactly 
divisible by 8, so more bytes could be marked initialised in the new 
block and more bytes copied from the old block than were initialised, 
causing spurious Valgrind warnings (reported by Dan Kegel). Therefore, 
the mark_block_initialized and memcpy calls in the "hard way" path must 
use the actual size, not the block size.

The offsets and sizes passed to clear_block and mark_block_uninitialized 
are fixed to use the old actual size instead of the old block size.
---
  dlls/ntdll/heap.c |   28 +++++++++++++++-------------
  1 files changed, 15 insertions(+), 13 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: b0078c99fd9105059d7e5a712dc5e73e4bc7a201.diff
Type: text/x-patch
Size: 3498 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20080220/cbdb5398/attachment.bin 


More information about the wine-patches mailing list