tony2001                Thu Feb 22 23:40:39 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/posix  posix.c 
  Log:
  MFH: check for buflen (on FreeBSD _SC_GETGR_R_SIZE_MAX is not implemented)
  patch by stas at FreeBSD dot org
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/posix/posix.c?r1=1.70.2.3.2.14&r2=1.70.2.3.2.15&diff_format=u
Index: php-src/ext/posix/posix.c
diff -u php-src/ext/posix/posix.c:1.70.2.3.2.14 
php-src/ext/posix/posix.c:1.70.2.3.2.15
--- php-src/ext/posix/posix.c:1.70.2.3.2.14     Sat Feb 10 00:50:38 2007
+++ php-src/ext/posix/posix.c   Thu Feb 22 23:40:39 2007
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: posix.c,v 1.70.2.3.2.14 2007/02/10 00:50:38 tony2001 Exp $ */
+/* $Id: posix.c,v 1.70.2.3.2.15 2007/02/22 23:40:39 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -147,7 +147,7 @@
 static PHP_MINFO_FUNCTION(posix)
 {
        php_info_print_table_start();
-       php_info_print_table_row(2, "Revision", "$Revision: 1.70.2.3.2.14 $");
+       php_info_print_table_row(2, "Revision", "$Revision: 1.70.2.3.2.15 $");
        php_info_print_table_end();
 }
 /* }}} */
@@ -887,6 +887,10 @@
 #if defined(ZTS) && defined(HAVE_GETGRGID_R) && defined(_SC_GETGR_R_SIZE_MAX)
        
        grbuflen = sysconf(_SC_GETGR_R_SIZE_MAX);
+       if (grbuflen < 1) {
+               RETURN_FALSE;
+       }
+
        grbuf = emalloc(grbuflen);
 
        ret = getgrgid_r(gid, &_g, grbuf, grbuflen, &retgrptr);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to