Fix (scary) overrun bug in group allocation stuff.
authormdw <mdw>
Wed, 24 Sep 1997 09:48:45 +0000 (09:48 +0000)
committermdw <mdw>
Wed, 24 Sep 1997 09:48:45 +0000 (09:48 +0000)
src/become.c

index d94e3c2..e73f5da 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: become.c,v 1.10 1997/09/17 10:14:10 mdw Exp $
+ * $Id: become.c,v 1.11 1997/09/24 09:48:45 mdw Exp $
  *
  * Main code for `become'
  *
 /*----- Revision history --------------------------------------------------*
  *
  * $Log: become.c,v $
- * Revision 1.10  1997/09/17 10:14:10  mdw
+ * Revision 1.11  1997/09/24 09:48:45  mdw
+ * Fix (scary) overrun bug in group allocation stuff.
+ *
+ * Revision 1.10  1997/09/17  10:14:10  mdw
  * Fix a typo.  Support service names in `--port' option.
  *
  * Revision 1.9  1997/09/10 10:28:05  mdw
@@ -304,8 +307,8 @@ static int bc__addGroups(gid_t *g, int *png, const gid_t *a, int na)
 
     /* --- See if there's room for more --- */
 
-    if (ng > NGROUPS_MAX) {
-      moan("too many groups (system limit exceeded -- some have been lost");
+    if (ng >= NGROUPS_MAX) {
+      moan("too many groups (system limit exceeded) -- some have been lost");
       *png = ng;
       return (-1);
     }