aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/async_session.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2023-11-10 08:56:29 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2023-11-10 08:56:29 +0000
commitaca7d247ccd1d1c6abbd96fc0b18f8d613b9a101 (patch)
treedc8fed89072bd426151c8d4de5b260d3245f7f5d /src/libserver/async_session.c
parent4beec4e027e10135ada07015a0f991d97ca83fee (diff)
downloadrspamd-aca7d247ccd1d1c6abbd96fc0b18f8d613b9a101.tar.gz
rspamd-aca7d247ccd1d1c6abbd96fc0b18f8d613b9a101.zip
[Fix] Fix bad access when printing pending events on failure path
Diffstat (limited to 'src/libserver/async_session.c')
-rw-r--r--src/libserver/async_session.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libserver/async_session.c b/src/libserver/async_session.c
index 962d51368..baaee627e 100644
--- a/src/libserver/async_session.c
+++ b/src/libserver/async_session.c
@@ -196,10 +196,10 @@ void rspamd_session_remove_event_full(struct rspamd_async_session *session,
search_ev.user_data = ud;
k = kh_get(rspamd_events_hash, session->events, &search_ev);
if (k == kh_end(session->events)) {
- gchar t;
- msg_err_session("cannot find event: %p(%p) from %s", fin, ud, event_source);
- kh_foreach(session->events, found_ev, t, {
+ msg_err_session("cannot find event: %p(%p) from %s (%d total events)", fin, ud,
+ event_source, (int) kh_size(session->events));
+ kh_foreach_key(session->events, found_ev, {
msg_err_session("existing event %s (%s): %p(%p)",
found_ev->subsystem,
found_ev->event_source,
@@ -207,8 +207,6 @@ void rspamd_session_remove_event_full(struct rspamd_async_session *session,
found_ev->user_data);
});
- (void) t;
-
g_assert_not_reached();
}