From: Antony Dovgal Date: Fri, 21 Sep 2007 14:05:18 +0000 (+0000) Subject: MFH: check the return value of getgroups() for -1 (coverity issue #390) X-Git-Tag: php-5.2.5RC1~108 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=074b4e51f02453ad7db218f8e4a31bbbb05662c0;p=php MFH: check the return value of getgroups() for -1 (coverity issue #390) --- diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 0340f86afc..cfc364d2f4 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -821,7 +821,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