Skip to content

Commit c0178cc

Browse files
committed
Use known length
1 parent c12b19b commit c0178cc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/session/session.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1864,13 +1864,13 @@ PHP_FUNCTION(session_get_cookie_params)
18641864
add_assoc_long(return_value, "lifetime", PS(cookie_lifetime));
18651865
// TODO Use add_assoc_str() but figure out why it emits a
18661866
// Zend/zend_types.h:1222: zend_gc_delref: Assertion `(zval_gc_flags((p)->u.type_info) & ((1<<7)|(1<<8))) != (1<<7)' failed.
1867-
add_assoc_string(return_value, "path", ZSTR_VAL(PS(cookie_path)));
1868-
add_assoc_string(return_value, "domain", ZSTR_VAL(PS(cookie_domain)));
1867+
add_assoc_stringl(return_value, "path", ZSTR_VAL(PS(cookie_path)), ZSTR_LEN(PS(cookie_path)));
1868+
add_assoc_stringl(return_value, "domain", ZSTR_VAL(PS(cookie_domain)), ZSTR_LEN(PS(cookie_domain)));
18691869
add_assoc_bool(return_value, "secure", PS(cookie_secure));
18701870
add_assoc_bool(return_value, "httponly", PS(cookie_httponly));
18711871
// TODO Use add_assoc_str() but figure out why it emits a
18721872
// Zend/zend_types.h:1222: zend_gc_delref: Assertion `(zval_gc_flags((p)->u.type_info) & ((1<<7)|(1<<8))) != (1<<7)' failed.
1873-
add_assoc_string(return_value, "samesite", ZSTR_VAL(PS(cookie_samesite)));
1873+
add_assoc_stringl(return_value, "samesite", ZSTR_VAL(PS(cookie_samesite)), ZSTR_LEN(PS(cookie_samesite)));
18741874
}
18751875
/* }}} */
18761876

0 commit comments

Comments
 (0)