tony2001                Thu Feb 22 23:40:26 2007 UTC

  Modified files:              
    /php-src/ext/posix  posix.c 
  Log:
  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.92&r2=1.93&diff_format=u
Index: php-src/ext/posix/posix.c
diff -u php-src/ext/posix/posix.c:1.92 php-src/ext/posix/posix.c:1.93
--- php-src/ext/posix/posix.c:1.92      Sat Feb 10 00:50:29 2007
+++ php-src/ext/posix/posix.c   Thu Feb 22 23:40:25 2007
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: posix.c,v 1.92 2007/02/10 00:50:29 tony2001 Exp $ */
+/* $Id: posix.c,v 1.93 2007/02/22 23:40:25 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.92 $");
+       php_info_print_table_row(2, "Revision", "$Revision: 1.93 $");
        php_info_print_table_end();
 }
 /* }}} */
@@ -885,6 +885,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