Skip to content

Commit 0acba59

Browse files
committed
Fix GH-15395: avoid copying empty auth password for PHP_AUTH_PW.
But we still consider the authentication handling Basic part successful.
1 parent 836e6fa commit 0acba59

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

main/main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2672,7 +2672,12 @@ PHPAPI int php_handle_auth_data(const char *auth)
26722672
if (pass) {
26732673
*pass++ = '\0';
26742674
SG(request_info).auth_user = estrndup(ZSTR_VAL(user), ZSTR_LEN(user));
2675-
SG(request_info).auth_password = estrdup(pass);
2675+
2676+
if (strlen(pass) > 0) {
2677+
SG(request_info).auth_password = estrdup(pass);
2678+
} else {
2679+
SG(request_info).auth_password = NULL;
2680+
}
26762681
ret = 0;
26772682
}
26782683
zend_string_free(user);

0 commit comments

Comments
 (0)