diff options
Diffstat (limited to 'src/sp_cookie_encryption.c')
| -rw-r--r-- | src/sp_cookie_encryption.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sp_cookie_encryption.c b/src/sp_cookie_encryption.c index 2bb305f..2d6c938 100644 --- a/src/sp_cookie_encryption.c +++ b/src/sp_cookie_encryption.c | |||
| @@ -209,10 +209,10 @@ PHP_FUNCTION(sp_setcookie) { | |||
| 209 | cookie_samesite = (cookie_node->samesite == lax) ? SAMESITE_COOKIE_FORMAT SP_TOKEN_SAMESITE_LAX | 209 | cookie_samesite = (cookie_node->samesite == lax) ? SAMESITE_COOKIE_FORMAT SP_TOKEN_SAMESITE_LAX |
| 210 | : SAMESITE_COOKIE_FORMAT SP_TOKEN_SAMESITE_STRICT; | 210 | : SAMESITE_COOKIE_FORMAT SP_TOKEN_SAMESITE_STRICT; |
| 211 | /* Concatenating everything, as is in PHP internals */ | 211 | /* Concatenating everything, as is in PHP internals */ |
| 212 | samesite = zend_string_extend(path, ZSTR_LEN(path) + strlen(cookie_samesite) + 1, 0); | 212 | samesite = zend_string_init(ZSTR_VAL(path), ZSTR_LEN(path), 0); |
| 213 | samesite = zend_string_extend(samesite, ZSTR_LEN(path) + strlen(cookie_samesite) + 1, 0); | ||
| 213 | memcpy(ZSTR_VAL(samesite) + ZSTR_LEN(path), cookie_samesite, strlen(cookie_samesite) + 1); | 214 | memcpy(ZSTR_VAL(samesite) + ZSTR_LEN(path), cookie_samesite, strlen(cookie_samesite) + 1); |
| 214 | ZVAL_STR_COPY(¶ms[3], samesite); | 215 | ZVAL_STR_COPY(¶ms[3], samesite); |
| 215 | zend_string_release(path); | ||
| 216 | } else if (path) { | 216 | } else if (path) { |
| 217 | ZVAL_STR_COPY(¶ms[3], path); | 217 | ZVAL_STR_COPY(¶ms[3], path); |
| 218 | } | 218 | } |
