Skip to content

Commit b1184ea

Browse files
Girgiasjorgsowa
authored andcommitted
Use new API for checking if string has NUL bytes
1 parent 0847552 commit b1184ea

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
@@ -685,7 +685,7 @@ static bool is_session_name_valid(const zend_string *name, int diagnostic_type)
685685
return false;
686686
}
687687
/* NUL bytes are not allowed */
688-
if (ZSTR_LEN(name) != strlen(ZSTR_VAL(name))) {
688+
if (zend_str_has_nul_byte(name)) {
689689
if (diagnostic_type) {
690690
php_error_docref(NULL, diagnostic_type, "session.name \"%s\" cannot contain NUL bytes", ZSTR_VAL(name));
691691
}

0 commit comments

Comments
 (0)