Skip to content

Commit 9c68853

Browse files
committed
ext/session: copy zstr instead of initializing a new one
1 parent 43fe9fd commit 9c68853

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/session/session.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,7 +1485,7 @@ PHPAPI const ps_serializer *_php_find_ps_serializer(const char *name)
14851485
static void ppid2sid(zval *ppid) {
14861486
ZVAL_DEREF(ppid);
14871487
if (Z_TYPE_P(ppid) == IS_STRING) {
1488-
PS(id) = zend_string_init(Z_STRVAL_P(ppid), Z_STRLEN_P(ppid), 0);
1488+
PS(id) = zend_string_copy(Z_STR_P(ppid));
14891489
PS(send_cookie) = 0;
14901490
} else {
14911491
PS(id) = NULL;
@@ -3199,7 +3199,7 @@ static zend_result php_session_rfc1867_callback(unsigned int event, void *event_
31993199
progress->post_bytes_processed = zend_hash_str_find(Z_ARRVAL(progress->data), "bytes_processed", sizeof("bytes_processed") - 1);
32003200

32013201
php_rinit_session(0);
3202-
PS(id) = zend_string_init(Z_STRVAL(progress->sid), Z_STRLEN(progress->sid), 0);
3202+
PS(id) = zend_string_copy(Z_STR(progress->sid));
32033203
if (progress->apply_trans_sid) {
32043204
/* Enable trans sid by modifying flags */
32053205
PS(use_trans_sid) = 1;

0 commit comments

Comments
 (0)