From: Sebastian Marsching Date: Tue, 8 Oct 2024 19:05:35 +0000 (+0200) Subject: [Fix] Avoid null-bytes in Log-Tag header value. X-Git-Tag: 3.10.1~10^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2a8c894e714440ff64df56a582944dfebae55c8f;p=rspamd.git [Fix] Avoid null-bytes in Log-Tag header value. This fixes #5178. --- diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c index dbdd2e5a7..e2a866178 100644 --- a/src/rspamd_proxy.c +++ b/src/rspamd_proxy.c @@ -38,6 +38,7 @@ #include "libmime/lang_detection.h" #include +#include #ifdef HAVE_NETINET_TCP_H #include /* for TCP_NODELAY */ @@ -2205,7 +2206,7 @@ proxy_client_finish_handler(struct rspamd_http_connection *conn, rspamd_http_message_remove_header(msg, "Connection"); rspamd_http_message_remove_header(msg, "Key"); rspamd_http_message_add_header_len(msg, LOG_TAG_HEADER, session->pool->tag.uid, - sizeof(session->pool->tag.uid)); + strnlen(session->pool->tag.uid, sizeof(session->pool->tag.uid))); proxy_open_mirror_connections(session); rspamd_http_connection_reset(session->client_conn);