This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
mg.c uses a fixed NGROUPS contant
authorperlbug-followup@perl.org <perlbug-followup@perl.org>
Fri, 23 Oct 2009 15:20:38 +0000 (08:20 -0700)
committerAndy Dougherty <doughera@lafayette.edu>
Mon, 26 Oct 2009 16:42:07 +0000 (12:42 -0400)
commitfb4089e0451edf57bb8c2f8e853074872a4ac7d3
treed9019ba3fec3b6372bd3a5b344bcb6037164ba1d
parent0abd0d78a73da1c4d13b1c700526b7e5d03b32d4
mg.c uses a fixed NGROUPS contant

# New Ticket Created by  casper.dik@sun.com
# Please include the string:  [perl #69977]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=69977 >

This is a bug report for perl from casper.dik@sun.com,
generated with the help of perlbug 1.36 running under perl 5.10.0.

-----------------------------------------------------------------
[Please enter your report here]

In mg.c NGROUPS is defined as follows:

#if defined(HAS_SETGROUPS)
#  ifndef NGROUPS
#    define NGROUPS 32
#  endif
#endif

and uses it later here:

  2632  #ifdef HAS_SETGROUPS
  2633          {
  2634              const char *p = SvPV_const(sv, len);
  2635              Groups_t *gary = NULL;
  2636
  2637              while (isSPACE(*p))
  2638                  ++p;
  2639              PL_egid = Atol(p);
  2640              for (i = 0; i < NGROUPS; ++i) {
  2641                  while (*p && !isSPACE(*p))
  2642                      ++p;
  2643                  while (isSPACE(*p))
  2644                      ++p;
  2645                  if (!*p)
  2646                      break;
  2647                  if(!gary)
  2648                      Newx(gary, i + 1, Groups_t);
  2649                  else
  2650                      Renew(gary, i + 1, Groups_t);
  2651                  gary[i] = Atol(p);
  2652              }
  2653              if (i)
  2654                  (void)setgroups(i, gary);
  2655              Safefree(gary);
  2656          }
  2657  #else  /* HAS_SETGROUPS */

This should be changed as follows
mg.c