Skip to content

Commit da4185a

Browse files
authored
Use zend_str_has_nul_byte instead of memchr (#21680)
1 parent 0f3e741 commit da4185a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/session/session.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ static PHP_INI_MH(OnUpdateSaveDir)
641641

642642
/* Only do the open_basedir check at runtime */
643643
if (stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) {
644-
if (memchr(ZSTR_VAL(new_value), '\0', ZSTR_LEN(new_value)) != NULL) {
644+
if (zend_str_has_nul_byte(new_value)) {
645645
return FAILURE;
646646
}
647647

ext/soap/soap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ static PHP_INI_MH(OnUpdateCacheDir)
387387
if (stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) {
388388
char *p;
389389

390-
if (memchr(ZSTR_VAL(new_value), '\0', ZSTR_LEN(new_value)) != NULL) {
390+
if (zend_str_has_nul_byte(new_value)) {
391391
return FAILURE;
392392
}
393393

0 commit comments

Comments
 (0)