Skip to content

Commit 91a5028

Browse files
Girgiasjorgsowa
authored andcommitted
Use new API for checking if string has NUL bytes
1 parent e02bf26 commit 91a5028

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
@@ -708,7 +708,7 @@ static bool is_session_name_valid(const zend_string *name, int diagnostic_type)
708708
return false;
709709
}
710710
/* NUL bytes are not allowed */
711-
if (ZSTR_LEN(name) != strlen(ZSTR_VAL(name))) {
711+
if (zend_str_has_nul_byte(name)) {
712712
if (diagnostic_type) {
713713
php_error_docref(NULL, diagnostic_type, "session.name \"%s\" cannot contain NUL bytes", ZSTR_VAL(name));
714714
}

0 commit comments

Comments
 (0)