This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On 03/23/2012 08:59 PM, Jeff Law wrote:Thanks for the reminder, we have the same problem with folks forgetting to do that in GCC ;-)
__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.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |