summaryrefslogtreecommitdiff
path: root/src/sp_session.c
diff options
context:
space:
mode:
authorChristian Göttsche2026-02-22 22:11:05 +0100
committerJulien Voisin2026-02-22 23:58:33 +0100
commit31d70da1ff61480f51b8ca747bc8c8d8a37c5061 (patch)
tree8d18c65e60aa9c4d31df4c234b8a580688295978 /src/sp_session.c
parentb441bfe693435f5d8c8ae4fd04ec3d4dae49070f (diff)
Log session ID lengths on failure
Diffstat (limited to 'src/sp_session.c')
-rw-r--r--src/sp_session.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sp_session.c b/src/sp_session.c
index 228e581..568271b 100644
--- a/src/sp_session.c
+++ b/src/sp_session.c
@@ -22,15 +22,15 @@ static int (*old_s_write)(PS_WRITE_ARGS);
22static int (*previous_sessionRINIT)(INIT_FUNC_ARGS) = NULL; 22static int (*previous_sessionRINIT)(INIT_FUNC_ARGS) = NULL;
23static ZEND_INI_MH((*old_OnUpdateSaveHandler)) = NULL; 23static ZEND_INI_MH((*old_OnUpdateSaveHandler)) = NULL;
24 24
25static void check_sid_length(zend_string *sid) { 25static void check_sid_length(const zend_string *sid) {
26 const sp_config_session *cfg = &(SPCFG(session)); 26 const sp_config_session *cfg = &(SPCFG(session));
27 27
28 if (sid) { 28 if (sid) {
29 if (cfg->sid_min_length && ZSTR_LEN(sid) < cfg->sid_min_length) { 29 if (cfg->sid_min_length && ZSTR_LEN(sid) < cfg->sid_min_length) {
30 sp_log_auto("session", cfg->simulation, "Session ID is too short"); 30 sp_log_auto("session", cfg->simulation, "Session ID is too short (sid=%zu min=%zu)", ZSTR_LEN(sid), (size_t)cfg->sid_min_length);
31 } 31 }
32 if (cfg->sid_max_length && ZSTR_LEN(sid) > cfg->sid_max_length) { 32 if (cfg->sid_max_length && ZSTR_LEN(sid) > cfg->sid_max_length) {
33 sp_log_auto("session", cfg->simulation, "Session ID is too long"); 33 sp_log_auto("session", cfg->simulation, "Session ID is too long (sid=%zu max=%zu)", ZSTR_LEN(sid), (size_t)cfg->sid_max_length);
34 } 34 }
35 } 35 }
36} 36}