ntdll: send_debug_event: don't send uninitialized bytes (try 2)

Dan Kegel dank at kegel.com
Fri Nov 16 18:34:10 CST 2007

This try uses FIELD_OFFSET as suggested by Rob.   Also preserves
the property of the existing code that an insane parameter
count doesn't cause a buffer overrun.  (That might not
really be needed, I'm just being paranoid.  If it really is needed,
maybe RtlRaiseException should check its parameters
more strictly.)

This patch is a slight optimization; it avoids sending
unused and uninitialized parts of the exception record
to the server.  (This is the other side of
Both stand alone, they don't need to go together.)

Found via Valgrind warning:
 Syscall param writev(vector[2]) points to uninitialised byte(s)
    at 0x40007F2: (within /lib/ld-2.5.so)
    by 0x44087F4: wine_server_call (server.c:244)
    by 0x43DFF48: send_debug_event (exception.c:207)
    by 0x43E01FE: raise_exception (exception.c:364)
    by 0x43E05A8: __regs_RtlRaiseException (exception.c:395)
    by 0x4409A3B: raise_segv_exception (signal_i386.c:1030)
    by 0xDEADBABD: ???
    by 0x676CAB2: DOSMEM_InitDosMemory (dosmem.c:172)
    by 0x676CF31: DllMain (dosvm.c:708)
when installing Word 97 Viewer, but probably comes up
in many places.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ntdll-exception-optimize-2.patch
Type: text/x-patch
Size: 1064 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20071116/962f364f/attachment-0001.bin 

More information about the wine-patches mailing list