[ PATCH] Fix typo in nss_getent

Jeff Law law@redhat.com
Fri Mar 23 20:00:00 GMT 2012


__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
[... ]

2012-03-23 Jeff Law  <law@redhat.com>

	* nss/getnssent.c (__nss_getent): Fix typo.


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120323/4b1f97bf/attachment.ksh>


More information about the Libc-alpha mailing list