mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
check the return value of getgroups() for -1 (coverity issue #390)
This commit is contained in:
parent
cd519f058c
commit
fba42a8530
1 changed files with 1 additions and 1 deletions
|
@ -877,7 +877,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ
|
||||||
gid_t *gids;
|
gid_t *gids;
|
||||||
|
|
||||||
groups = getgroups(0, NULL);
|
groups = getgroups(0, NULL);
|
||||||
if(groups) {
|
if(groups > 0) {
|
||||||
gids=(gid_t *)safe_emalloc(groups, sizeof(gid_t), 0);
|
gids=(gid_t *)safe_emalloc(groups, sizeof(gid_t), 0);
|
||||||
n=getgroups(groups, gids);
|
n=getgroups(groups, gids);
|
||||||
for(i=0;i<n;i++){
|
for(i=0;i<n;i++){
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue