com php-src: Fixed bug #69121 (Segfault in get_current_user when script owner is not in passwd with ZTS build): NEWS main/main.c
| From: | Xinchen Hui | Date: | Fri, 27 Feb 2015 04:00:52 +0000 |
| Subject: | com php-src: Fixed bug #69121 (Segfault in get_current_user when script owner is not in passwd with ZTS build): NEWS main/main.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-85108@lists.php.net to get a copy of this message | ||
Commit: ebfc49aa918044e65b3704933224a807d98b4e68
Author: Xinchen Hui <laruence@php.net> Fri, 27 Feb 2015 12:00:52 +0800
Parents: 3e82816ba1a82843a352ce4050b2010fd9932dee
Branches: PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ebfc49aa918044e65b3704933224a807d98b4e68
Log:
Fixed bug #69121 (Segfault in get_current_user when script owner is not in passwd with ZTS build)
Bugs:
https://bugs.php.net/69121
Changed paths:
M NEWS
M main/main.c
Diff:
diff --git a/NEWS b/NEWS
index a020e69..0169572 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ PHP NEWS
?? ??? 2015, PHP 5.5.23
- Core:
+ . Fixed bug #69121 (Segfault in get_current_user when script owner is not
+ in passwd with ZTS build). (dan at syneto dot net)
. Fixed bug #65593 (Segfault when calling ob_start from output buffering
callback). (Mike)
. Fixed bug #69017 (Fail to push to the empty array with the constant value
diff --git a/main/main.c b/main/main.c
index 733786e..1f6c4cf 100644
--- a/main/main.c
+++ b/main/main.c
@@ -1247,6 +1247,11 @@ PHPAPI char *php_get_current_user(TSRMLS_D)
return "";
}
pwd = &_pw;
+
+ if (retpwptr == NULL) {
+ efree(pwbuf);
+ return "";
+ }
#else
if ((pwd=getpwuid(pstat->st_uid))==NULL) {
return "";