Skip to content

Commit ebfc49a

Browse files
committed
Fixed bug #69121 (Segfault in get_current_user when script owner is not in passwd with ZTS build)
1 parent 3e82816 commit ebfc49a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ PHP NEWS
33
?? ??? 2015, PHP 5.5.23
44

55
- Core:
6+
. Fixed bug #69121 (Segfault in get_current_user when script owner is not
7+
in passwd with ZTS build). (dan at syneto dot net)
68
. Fixed bug #65593 (Segfault when calling ob_start from output buffering
79
callback). (Mike)
810
. Fixed bug #69017 (Fail to push to the empty array with the constant value

main/main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,11 @@ PHPAPI char *php_get_current_user(TSRMLS_D)
12471247
return "";
12481248
}
12491249
pwd = &_pw;
1250+
1251+
if (retpwptr == NULL) {
1252+
efree(pwbuf);
1253+
return "";
1254+
}
12501255
#else
12511256
if ((pwd=getpwuid(pstat->st_uid))==NULL) {
12521257
return "";

0 commit comments

Comments
 (0)