[PATCH] dlls/msxml3: Using strlenW instead of SysStringLen to check node name length
Eric Lanz
elanz at icarusstudios.com
Mon Mar 22 15:50:02 CDT 2010
Thank you,
I will take a look at your changes, correct my work and re-submit.
Eric
On Mar 22, 2010, at 4:44 PM, Nikolay Sivov wrote:
> On 3/22/2010 23:26, Eric Lanz wrote:
>> Hello,
>>
>> Decided to keep it simple for my first patch. SysStringLen was returning 0 for bstrs from our updater application which caused the domdoc_createNode function to exit early even though the bstr actually contained a valid name. It seems that other functions in this file use strlenW for this purpose which seems to always return the correct length.
>>
>> Eric
>>
> Hi, Eric.
>
> It's means that you don't really use BSTR in your program, or that your BSTR is broken. If it works on Windows it should work with Wine too of course. I already fixed similar bug in ::loadXML of IXMLDOMDocument.
>
> You need to add a test for that (look at domdoc.c for '_loadXML' and 'broken BSTR' keywords, there's one already).
> Speaking about a patch - you should avoid a complexity of strlenW here:
>
>> - if (!name || SysStringLen(name) == 0) return E_FAIL;
>> + if (!name || strlenW(name) == 0) return E_FAIL;
>>
> Just do:
>> if (!name || name[0] == 0) return E_FAIL;
>>
>>
>
>
More information about the wine-devel
mailing list