1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00

Fix reallocation bug in last nss_files change.

This commit is contained in:
Ulrich Drepper
2011-04-21 12:07:52 -04:00
parent 877175d8ea
commit e84142d2a9
2 changed files with 7 additions and 1 deletions

View File

@@ -1,3 +1,8 @@
2011-04-21 Ulrich Drepper <drepper@gmail.com>
* nss/nss_files/files-initgroups.c (_nss_files_initgroups_dyn): Fix
problem in reallocation in last patch.
2011-04-20 Ulrich Drepper <drepper@gmail.com> 2011-04-20 Ulrich Drepper <drepper@gmail.com>
* sunrpc/Makefile: Move inclusion of Rules. * sunrpc/Makefile: Move inclusion of Rules.

View File

@@ -70,7 +70,8 @@ _nss_files_initgroups_dyn (const char *user, gid_t group, long int *start,
size_t newbuflen = 2 * buflen; size_t newbuflen = 2 * buflen;
if (buffer_use_malloc || ! __libc_use_alloca (buflen + newbuflen)) 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) if (newbuf == NULL)
{ {
*errnop = ENOMEM; *errnop = ENOMEM;