[shlwapi] Add NULL checks to StrCpyW and StrCatW

carlo.bramix at libero.it carlo.bramix at libero.it
Wed Apr 18 14:51:05 CDT 2012


The tests implemented in the previous patch have been commented because they 
crashes on Win2K SP4, according to the current coding style and solution 
currently adopted in this source file.

Sincerely,

Carlo Bramini.


>----Messaggio originale----
>Da: carlo.bramix at libero.it
>Data: 16/04/2012 22.23
>A: <wine-patches at winehq.org>
>Ogg: [shlwapi] Add NULL checks to StrCpyW and StrCatW
>
>I updated the patch with improved tests into test_StrCpyW() as requested.
>
>Sincerely,
>
>Carlo Bramini.
>
>>----Messaggio originale----
>>Da: 00cpxxx at gmail.com
>>Data: 15/04/2012 5.09
>>A: "carlo.bramix at libero.it"<carlo.bramix at libero.it>
>>Ogg: Re: [shlwapi] Add NULL checks to StrCpyW and StrCatW
>>
>>You probably will need to add tests to prove this behavior.
>>
>>Best wishes,
>>Bruno
>>
>>2012/4/14 carlo.bramix at libero.it <carlo.bramix at libero.it>:
>>> From Bug #25261:
>>>
>>> I looked the terminal output in the attachment of this bug and then I did 
>some
>>> debugging on Windows.
>>> I tested StrCpyW and also StrCatW (my intuition suggested me to do so) 
and 
>I
>>> discovered that:
>>>
>>> StrCpyW(myDestination, mySource) does not crash, it copies the content of
>>> mySource into myDestination, pointer to myDestination is returned.
>>>
>>> StrCpyW(myDestination, NULL) does not crash, it leaves myDestination
>>> unchanged, pointer to myDestination is returned.
>>>
>>> StrCpyW(NULL, NULL) does not crash, it returns NULL.
>>>
>>> StrCatW has the same behavior of StrCpyW.
>>> Actually, it seems to me that many string functions implemented into 
>shlwapi
>>> are already protected against wrong parameters, evidently StrCpyW and 
>StrCatW
>>> have need the same fixes that have been made elsewhere, since strcpyW and
>>> strcatW don't do it.
>>> Attached patch should fix the defect, it just adds the test if both 
>parameters
>>> are not NULL before proceeding to the copy.
>>>
>>> Sincerely,
>>>
>>> Carlo Bramini.
>>>
>>>
>>>
>
>

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: string.txt
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20120418/e72050c5/attachment.txt>


More information about the wine-patches mailing list