msxml3/tests: VT_EMPTY is not a string (resend 2)

Dan Kegel dank at kegel.com
Mon Jun 23 01:00:45 CDT 2008


Sent wrong patch.  This one should have the NULL...

On Sun, Jun 22, 2008 at 2:32 PM, Dan Kegel <dank at kegel.com> wrote:
> This time using NULL instead of (void *) 0.
>
> Casting a VT_EMPTY to a string gets you a null string.
> The test was doing that and taking the string length, then comparing to zero.
> Better to simply compare to null; that's a stronger test, and
> avoids generating a behind-the-scenes exception.
>
> kernel32/tests is the place to test that lstrlenW( badptr ) == 0,
> no need to duplicate that here.
>
> Passes on Wine and XP, and gets rid of the valgrind warning
>  Invalid read of size 2
>   at  strlenW (unicode.h:212)
>   by  lstrlenW (string.c:384)
>   by  test_xmlelem (xmlelem.c:83)
>   by  func_xmlelem (xmlelem.c:455)
>  Address 0x0 is not stack'd, malloc'd or (recently) free'd
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: msxml3-xmlelem.patch
Type: text/x-diff
Size: 1012 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20080622/578d2d43/attachment.patch 


More information about the wine-patches mailing list