From: Ulrich Drepper Date: Thu, 21 Apr 2011 16:07:52 +0000 (-0400) Subject: Fix reallocation bug in last nss_files change. X-Git-Tag: upstream/2.20~5491 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e84142d2a9eed278ecf869459a5de0b640074517;p=platform%2Fupstream%2Flinaro-glibc.git Fix reallocation bug in last nss_files change. --- diff --git a/ChangeLog b/ChangeLog index 934a23c..0c8282e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-04-21 Ulrich Drepper + + * nss/nss_files/files-initgroups.c (_nss_files_initgroups_dyn): Fix + problem in reallocation in last patch. + 2011-04-20 Ulrich Drepper * sunrpc/Makefile: Move inclusion of Rules. diff --git a/nss/nss_files/files-initgroups.c b/nss/nss_files/files-initgroups.c index 1c288e5..4c7b9f8 100644 --- a/nss/nss_files/files-initgroups.c +++ b/nss/nss_files/files-initgroups.c @@ -70,7 +70,8 @@ _nss_files_initgroups_dyn (const char *user, gid_t group, long int *start, size_t newbuflen = 2 * buflen; if (buffer_use_malloc || ! __libc_use_alloca (buflen + newbuflen)) { - char *newbuf = realloc (buffer, buflen); + void *newbuf = realloc (buffer_use_malloc ? buffer : NULL, + buflen); if (newbuf == NULL) { *errnop = ENOMEM;