Skip to content

Commit

Permalink
logsource: fix use after free in message processing debug log
Browse files Browse the repository at this point in the history
`log_pipe_forward_msg()` frees `msg`.

Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Szilard Parrag <szilard.parrag@axoflow.com>
  • Loading branch information
alltilla committed Nov 4, 2024
1 parent a967442 commit 4811595
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/logsource.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ log_source_queue(LogPipe *s, LogMessage *msg, const LogPathOptions *path_options

/* message setup finished, send it out */

guint64 rcptid = msg->rcptid;

stats_counter_inc(self->metrics.recvd_messages);
stats_counter_set_time(self->metrics.last_message_seen, msg->timestamps[LM_TS_RECVD].ut_sec);
stats_byte_counter_add(&self->metrics.recvd_bytes, msg->recvd_rawmsg_size);
Expand All @@ -682,7 +684,8 @@ log_source_queue(LogPipe *s, LogMessage *msg, const LogPathOptions *path_options
}
msg_diagnostics("<<<<<< Source side message processing finish",
log_pipe_location_tag(s),
evt_tag_msg_reference(msg));
evt_tag_printf("msg", "%p", msg),
evt_tag_printf("rcptid", "%" G_GUINT64_FORMAT, rcptid));

msg_set_context(NULL);
}
Expand Down

0 comments on commit 4811595

Please sign in to comment.