From d0321f0863e8d2d22177df38fea065ecf5dfe02e Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 8 Feb 2022 09:05:35 +0000 Subject: [PATCH] [Minor] Off by one --- src/libutil/upstream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libutil/upstream.c b/src/libutil/upstream.c index d22e71354..447df7c57 100644 --- a/src/libutil/upstream.c +++ b/src/libutil/upstream.c @@ -666,7 +666,8 @@ rspamd_upstream_resolve_addrs (const struct upstream_list *ls, if (semicolon_pos != NULL && semicolon_pos > upstream->name) { if (sizeof (dns_name) > semicolon_pos - upstream->name) { - rspamd_strlcpy(dns_name, upstream->name, semicolon_pos - upstream->name); + rspamd_strlcpy(dns_name, upstream->name, + semicolon_pos - upstream->name + 1); } else { /* XXX: truncated */ -- 2.39.5