Skip to content

Commit 7ab79e4

Browse files
committed
Use new API for checking if string has NUL bytes
1 parent 6de4573 commit 7ab79e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/session/session.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ static bool is_session_name_valid(const zend_string *name, int diagnostic_type)
652652
return false;
653653
}
654654
/* NUL bytes are not allowed */
655-
if (ZSTR_LEN(name) != strlen(ZSTR_VAL(name))) {
655+
if (zend_str_has_nul_byte(name)) {
656656
if (diagnostic_type) {
657657
php_error_docref(NULL, diagnostic_type, "session.name \"%s\" cannot contain NUL bytes", ZSTR_VAL(name));
658658
}

0 commit comments

Comments
 (0)