diff options
author | Sebastian Marsching <sebastian-git-2016@marsching.com> | 2024-10-08 21:05:35 +0200 |
---|---|---|
committer | Sebastian Marsching <sebastian-git-2016@marsching.com> | 2024-10-08 21:05:35 +0200 |
commit | 2a8c894e714440ff64df56a582944dfebae55c8f (patch) | |
tree | 8ae9e711cb96707fb16806377104343c63801200 /src | |
parent | ee3fa128888f77591be7f0ab6b29619fa4cc29ff (diff) | |
download | rspamd-2a8c894e714440ff64df56a582944dfebae55c8f.tar.gz rspamd-2a8c894e714440ff64df56a582944dfebae55c8f.zip |
[Fix] Avoid null-bytes in Log-Tag header value.
This fixes #5178.
Diffstat (limited to 'src')
-rw-r--r-- | src/rspamd_proxy.c | 3 |
1 files changed, 2 insertions, 1 deletions
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 <math.h> +#include <string.h> #ifdef HAVE_NETINET_TCP_H #include <netinet/tcp.h> /* 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); |