[patch] libstdc++/66327 don't pass null pointers to memcmp
Jonathan Wakely
jwakely@redhat.com
Fri May 29 23:24:00 GMT 2015
On 29/05/15 19:52 +0000, Jörg Richter wrote:
>Jonathan Wakely <jwakely <at> redhat.com> writes:
>
>> This is a rather brute force fix, but if noone has any better ideas
>> I'll commit this to the trunk and 4.9 and 5 branches tomorrow. (I
>> think it should go on the branches, because 4.9 is known to optimise
>> away null pointer checks after invalid calls to memcmp like this).
>
>How about comparing only the length against 0?
>The pointers must be != 0 if length > 0.
Like so? Yes, that's probably an improvement, because we need that
length anyway.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 959 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20150529/3eb61a3a/attachment.bin>
More information about the Libstdc++
mailing list