tony2001                Fri Apr 11 10:59:50 2008 UTC

  Modified files:              
    /php-src/ext/posix  posix.c 
  Log:
  fix 2 segfaults in ZTS mode
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/posix/posix.c?r1=1.97&r2=1.98&diff_format=u
Index: php-src/ext/posix/posix.c
diff -u php-src/ext/posix/posix.c:1.97 php-src/ext/posix/posix.c:1.98
--- php-src/ext/posix/posix.c:1.97      Tue Mar  4 23:39:15 2008
+++ php-src/ext/posix/posix.c   Fri Apr 11 10:59:50 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: posix.c,v 1.97 2008/03/04 23:39:15 felipe Exp $ */
+/* $Id: posix.c,v 1.98 2008/04/11 10:59:50 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.97 $");
+       php_info_print_table_row(2, "Revision", "$Revision: 1.98 $");
        php_info_print_table_end();
 }
 /* }}} */
@@ -873,7 +873,7 @@
 #if defined(ZTS) && defined(HAVE_GETGRGID_R) && defined(_SC_GETGR_R_SIZE_MAX)
        int ret;
        struct group _g;
-       struct group *retgrptr;
+       struct group *retgrptr = NULL;
        long grbuflen;
        char *grbuf;
 #endif
@@ -892,7 +892,7 @@
        grbuf = emalloc(grbuflen);
 
        ret = getgrgid_r(gid, &_g, grbuf, grbuflen, &retgrptr);
-       if (ret) {
+       if (ret || retgrptr == NULL) {
                POSIX_G(last_error) = ret;
                efree(grbuf);
                RETURN_FALSE;
@@ -1009,7 +1009,7 @@
        pwbuf = emalloc(pwbuflen);
 
        ret = getpwuid_r(uid, &_pw, pwbuf, pwbuflen, &retpwptr);
-       if (ret) {
+       if (ret || retpwptr == NULL) {
                POSIX_G(last_error) = ret;
                efree(pwbuf);
                RETURN_FALSE;



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

Reply via email to