Fix buffer allocation in files initgroups handler
authorAndreas Schwab <schwab@redhat.com>
Mon, 7 Nov 2011 10:43:13 +0000 (11:43 +0100)
committerAndreas Schwab <schwab@redhat.com>
Mon, 7 Nov 2011 10:49:51 +0000 (11:49 +0100)
ChangeLog
nss/nss_files/files-initgroups.c

index e57f098..b09f5ef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-07  Andreas Schwab  <schwab@redhat.com>
+
+       * nss/nss_files/files-initgroups.c (_nss_files_initgroups_dyn):
+       Fix size of allocated buffer.
+
 2011-11-04  Andreas Schwab  <schwab@redhat.com>
 
        [BZ #10103]
index c343b35..2f88f60 100644 (file)
@@ -73,7 +73,7 @@ _nss_files_initgroups_dyn (const char *user, gid_t group, long int *start,
          if (buffer_use_malloc || ! __libc_use_alloca (buflen + newbuflen))
            {
              void *newbuf = realloc (buffer_use_malloc ? buffer : NULL,
-                                     buflen);
+                                     newbuflen);
              if (newbuf == NULL)
                {
                  *errnop = ENOMEM;