summaryrefslogtreecommitdiff
path: root/ext/session/session.c
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>1999-09-12 12:27:11 +0000
committerSascha Schumann <sas@php.net>1999-09-12 12:27:11 +0000
commitac524d4b94da42d4384ba0e5b0646bc6cefc423c (patch)
tree38bc718bfeab7de500c0953fbe1ab2b4df910b77 /ext/session/session.c
parent2e844a07992bbef7bd22d61945fbdd82b02587f1 (diff)
downloadphp-git-ac524d4b94da42d4384ba0e5b0646bc6cefc423c.tar.gz
calculate length of cookie string correctly
Diffstat (limited to 'ext/session/session.c')
-rw-r--r--ext/session/session.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/session/session.c b/ext/session/session.c
index 51edab86d8..b87dfb9233 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -76,7 +76,7 @@ PHP_INI_BEGIN()
PHP_INI_ENTRY("session.serialize_handler", "php", PHP_INI_ALL, NULL)
PHP_INI_ENTRY("session.extern_referer_check", "", PHP_INI_ALL, NULL)
PHP_INI_ENTRY("session.entropy_file", "", PHP_INI_ALL, NULL)
- PHP_INI_ENTRY("session.entropy_length", "", PHP_INI_ALL, NULL)
+ PHP_INI_ENTRY("session.entropy_length", "0", PHP_INI_ALL, NULL)
PHP_INI_END()
PS_SERIALIZER_FUNCS(php);
@@ -374,10 +374,11 @@ static void _php_session_send_cookie(PSLS_D)
}
cookie = ecalloc(len + 1, 1);
- snprintf(cookie, len, COOKIE_FMT, PS(session_name), PS(id));
+ len = snprintf(cookie, len, COOKIE_FMT, PS(session_name), PS(id));
if (PS(lifetime) > 0) {
strcat(cookie, COOKIE_EXPIRES);
strcat(cookie, date_fmt);
+ len += strlen(COOKIE_EXPIRES) + strlen(date_fmt);
efree(date_fmt);
}