summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2015-02-27 12:00:52 +0800
committerXinchen Hui <laruence@php.net>2015-02-27 12:00:52 +0800
commitebfc49aa918044e65b3704933224a807d98b4e68 (patch)
treeae29bb4cc418a29847c8081a97c8efbdd195292e
parent3e82816ba1a82843a352ce4050b2010fd9932dee (diff)
downloadphp-git-ebfc49aa918044e65b3704933224a807d98b4e68.tar.gz
Fixed bug #69121 (Segfault in get_current_user when script owner is not in passwd with ZTS build)
-rw-r--r--NEWS2
-rw-r--r--main/main.c5
2 files changed, 7 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index a020e6954b..0169572b91 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 733786e447..1f6c4cf04d 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 "";