diff options
-rw-r--r-- | source3/lib/system.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c index 4009e63169..deca7e1b6a 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -673,7 +673,9 @@ int sys_getgroups(int setlen, gid_t *gidset) return -1; } - if((group_list = (GID_T *)malloc(setlen * sizoef(GID_T))) == NULL) { + if (setlen == 0) setlen = 1; + + if((group_list = (GID_T *)malloc(setlen * sizeof(GID_T))) == NULL) { DEBUG(0,("sys_getgroups: Malloc fail.\n")); return -1; } |