File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -1018,6 +1018,11 @@ PHP_FUNCTION(posix_getgrnam)
1018
1018
RETURN_FALSE ;
1019
1019
}
1020
1020
1021
+ /* getgrnam/_r() is buggy on Mac OSX 10.8, do early check for invalid empty name */
1022
+ if (name_len == 0 ) {
1023
+ RETURN_FALSE ;
1024
+ }
1025
+
1021
1026
#if defined(ZTS ) && defined(HAVE_GETGRNAM_R ) && defined(_SC_GETGR_R_SIZE_MAX )
1022
1027
buflen = sysconf (_SC_GETGR_R_SIZE_MAX );
1023
1028
if (buflen < 1 ) {
@@ -1120,7 +1125,7 @@ int php_posix_passwd_to_array(struct passwd *pw, zval *return_value) /* {{{ */
1120
1125
}
1121
1126
/* }}} */
1122
1127
1123
- /* {{{ proto array posix_getpwnam(string groupname)
1128
+ /* {{{ proto array posix_getpwnam(string username)
1124
1129
User database access (POSIX.1, 9.2.2) */
1125
1130
PHP_FUNCTION (posix_getpwnam )
1126
1131
{
@@ -1137,6 +1142,11 @@ PHP_FUNCTION(posix_getpwnam)
1137
1142
RETURN_FALSE ;
1138
1143
}
1139
1144
1145
+ /* getpwnam/_r() is buggy on Mac OSX 10.8, do early check for invalid empty name */
1146
+ if (name_len == 0 ) {
1147
+ RETURN_FALSE ;
1148
+ }
1149
+
1140
1150
#if defined(ZTS ) && defined(_SC_GETPW_R_SIZE_MAX ) && defined(HAVE_GETPWNAM_R )
1141
1151
buflen = sysconf (_SC_GETPW_R_SIZE_MAX );
1142
1152
if (buflen < 1 ) {
You can’t perform that action at this time.
0 commit comments