[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnulib] Re: [coreutils]/lib/getgroups.c, xmalloc usage...

From: Paul Eggert
Subject: [Bug-gnulib] Re: [coreutils]/lib/getgroups.c, xmalloc usage...
Date: 03 Dec 2003 02:22:12 -0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

"Alfred M. Szmidt" <address@hidden> writes:

>       gbuf = xmalloc (gbuf, n * sizeof *gbuf);

Thanks for reporting that.  I installed the following patch into
gnulib.  This code is fairly new and gets compiled only for ancient
hosts, which explains why nobody else has run into the problem yet.

2003-12-03  Paul Eggert  <address@hidden>

        * getgroups.c (getgroups): xmalloc takes one argument, not two.
        Bug reported by Alfred M. Szmidt.

Index: getgroups.c
RCS file: /cvsroot/gnulib/gnulib/lib/getgroups.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -p -u -r1.9 -r1.10
--- getgroups.c 29 Oct 2003 17:27:58 -0000      1.9
+++ getgroups.c 3 Dec 2003 10:17:42 -0000       1.10
@@ -48,7 +48,7 @@ getgroups (int n, GETGROUPS_T *group)
       /* No need to worry about address arithmetic overflow here,
         since the ancient systems that we're running on have low
         limits on the number of secondary groups.  */
-      gbuf = xmalloc (gbuf, n * sizeof *gbuf);
+      gbuf = xmalloc (n * sizeof *gbuf);
       n_groups = getgroups (n, gbuf);
       if (n_groups < n)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]