This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [ PATCH] Fix typo in nss_getent
- From: Andreas Jaeger <aj at suse dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Fri, 23 Mar 2012 21:08:45 +0100
- Subject: Re: [ PATCH] Fix typo in nss_getent
- References: <4F6CD62C.7020900@redhat.com>
On 03/23/2012 08:59 PM, Jeff Law wrote:
__nss_getent has the following code fragment:
if (*buffer == NULL)
{
*buffer_size = buflen;
*buffer = malloc (*buffer_size);
}
while (buffer != NULL
[ ... ]
The "buffer != NULL" clause in the WHILE statement will be eliminated as
it is always true (buffer was dereferenced in the prior IF statement,
thus it can't be NULL at the WHILE statement).
The original author clearly meant to test
while (*buffer != NULL
[... ]
The fix is fine - but please remember to update the copyright years as well.
Thanks,
Andreas
2012-03-23 Jeff Law <law@redhat.com>
* nss/getnssent.c (__nss_getent): Fix typo.
--
Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126