summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlav Morken <olav.morken@uninett.no>2014-07-03 09:39:29 (GMT)
committerOlav Morken <olav.morken@uninett.no>2014-07-03 09:40:53 (GMT)
commitd1ab7e2d4e60639246ad283a037ccf29a935ab52 (patch)
tree0dc9e397879bdb71580af66c5b55569e66243efa
parentc0e58fc0e287a90b99b827717b2aac683f25ef2d (diff)
downloadmodmellon-d1ab7e2d4e60639246ad283a037ccf29a935ab52.zip
modmellon-d1ab7e2d4e60639246ad283a037ccf29a935ab52.tar.gz
modmellon-d1ab7e2d4e60639246ad283a037ccf29a935ab52.tar.bz2
Fix access of uninitialized data when logging out.
Since the session data for an unused session isn't initialized, we may end up reading uninitialized data, leading to a segmentation fault.
-rw-r--r--auth_mellon_cache.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/auth_mellon_cache.c b/auth_mellon_cache.c
index 70c4879..308fc84 100644
--- a/auth_mellon_cache.c
+++ b/auth_mellon_cache.c
@@ -78,6 +78,11 @@ am_cache_entry_t *am_cache_lock(server_rec *s,
for(i = 0; i < mod_cfg->init_cache_size; i++) {
const char *tablekey;
+ if (table[i].key[0] == '\0') {
+ /* This entry is empty. Skip it. */
+ continue;
+ }
+
switch (type) {
case AM_CACHE_SESSION:
tablekey = table[i].key;