From fba42a8530ff596ef156a9ee5fe795f2d91b0dfe Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Fri, 21 Sep 2007 14:05:01 +0000 Subject: [PATCH] check the return value of getgroups() for -1 (coverity issue #390) --- ext/standard/filestat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 3ace3c7551..60a3a53ccb 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -877,7 +877,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ gid_t *gids; groups = getgroups(0, NULL); - if(groups) { + if(groups > 0) { gids=(gid_t *)safe_emalloc(groups, sizeof(gid_t), 0); n=getgroups(groups, gids); for(i=0;i