Whamcloud - gitweb
LU-2227 build: fix 'memory illegal access' errors
[fs/lustre-release.git] / lustre / utils / l_getidentity.c
index ff240eb..936f494 100644 (file)
@@ -428,6 +428,10 @@ int main(int argc, char **argv)
         maxgroups = sysconf(_SC_NGROUPS_MAX);
         if (maxgroups > NGROUPS_MAX)
                 maxgroups = NGROUPS_MAX;
+       if (maxgroups == -1) {
+               rc = -EINVAL;
+               goto out;
+       }
 
         size = offsetof(struct identity_downcall_data, idd_groups[maxgroups]);
         data = malloc(size);