cvs: php-src(PHP_5_2) /ext/standard filestat.c
| From: | Antony Dovgal | Date: | Fri, 21 Sep 2007 14:05:18 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /ext/standard filestat.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-46266@lists.php.net to get a copy of this message | ||
tony2001 Fri Sep 21 14:05:18 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/standard filestat.c
Log:
MFH: 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.136.2.8.2.13&r2=1.136.2.8.2.14&diff_format=u
Index: php-src/ext/standard/filestat.c
diff -u php-src/ext/standard/filestat.c:1.136.2.8.2.13
php-src/ext/standard/filestat.c:1.136.2.8.2.14
--- php-src/ext/standard/filestat.c:1.136.2.8.2.13 Mon Jul 23 23:03:09 2007
+++ php-src/ext/standard/filestat.c Fri Sep 21 14:05:18 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: filestat.c,v 1.136.2.8.2.13 2007/07/23 23:03:09 iliaa Exp $ */
+/* $Id: filestat.c,v 1.136.2.8.2.14 2007/09/21 14:05:18 tony2001 Exp $ */
#include "php.h"
#include "safe_mode.h"
@@ -821,7 +821,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++){