cvs: php-src /ext/standard filestat.c
| From: | Antony Dovgal | Date: | Fri, 21 Sep 2007 14:05:01 +0000 |
| Subject: | cvs: php-src /ext/standard filestat.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-46265@lists.php.net to get a copy of this message | ||
tony2001 Fri Sep 21 14:05:01 2007 UTC
Modified files:
/php-src/ext/standard filestat.c
Log:
check the return value of getgroups() for -1 (coverity issue #390)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/filestat.c?r1=1.163&r2=1.164&diff_format=u
Index: php-src/ext/standard/filestat.c
diff -u php-src/ext/standard/filestat.c:1.163 php-src/ext/standard/filestat.c:1.164
--- php-src/ext/standard/filestat.c:1.163 Sun Sep 2 11:53:51 2007
+++ php-src/ext/standard/filestat.c Fri Sep 21 14:05:01 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: filestat.c,v 1.163 2007/09/02 11:53:51 bjori Exp $ */
+/* $Id: filestat.c,v 1.164 2007/09/21 14:05:01 tony2001 Exp $ */
#include "php.h"
#include "fopen_wrappers.h"
@@ -877,7 +877,7 @@
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<n;i++){