This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [patch] libstdc++/66327 don't pass null pointers to memcmp
- From: JÃrg Richter <joerg dot richter at pdv-fs dot de>
- To: libstdc++ at gcc dot gnu dot org
- Date: Fri, 29 May 2015 19:52:08 +0000 (UTC)
- Subject: Re: [patch] libstdc++/66327 don't pass null pointers to memcmp
- Authentication-results: sourceware.org; auth=none
- References: <20150528223547 dot GT2985 at redhat dot com>
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.
- JÃrg