summaryrefslogtreecommitdiff
path: root/ext/standard/head.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/head.c')
-rw-r--r--ext/standard/head.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/standard/head.c b/ext/standard/head.c
index af945ff8e0..7240d777d3 100644
--- a/ext/standard/head.c
+++ b/ext/standard/head.c
@@ -94,8 +94,6 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t
if (domain) {
len += domain_len;
}
- cookie = emalloc(len + 100);
-
if (value && value_len == 0) {
/*
* MSIE doesn't delete a cookie when you set it to a null value
@@ -104,10 +102,10 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t
*/
time_t t = time(NULL) - 31536001;
dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, t, 0 TSRMLS_CC);
- sprintf(cookie, "Set-Cookie: %s=deleted; expires=%s", name, dt);
+ spprintf(&cookie, 0, "Set-Cookie: %s=deleted; expires=%s", name, dt);
efree(dt);
} else {
- sprintf(cookie, "Set-Cookie: %s=%s", name, value ? encoded_value : "");
+ spprintf(&cookie, 0, "Set-Cookie: %s=%s", name, value ? encoded_value : "");
if (expires > 0) {
strlcat(cookie, "; expires=", len + 100);
dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, expires, 0 TSRMLS_CC);