From 2a8c894e714440ff64df56a582944dfebae55c8f Mon Sep 17 00:00:00 2001 From: Sebastian Marsching Date: Tue, 8 Oct 2024 21:05:35 +0200 Subject: [PATCH] =?utf8?q?[Fix]=C2=A0Avoid=20null-bytes=20in=20Log-Tag=20h?= =?utf8?q?eader=20value.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This fixes #5178. --- src/rspamd_proxy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.39.5