From: Vsevolod Stakhov Date: Mon, 7 Feb 2022 22:08:29 +0000 (+0000) Subject: [Minor] Fix a corner case X-Git-Tag: 3.2~65 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7bf24f093da9151b8b8887fd40b64a51d1116437;p=thirdparty%2Frspamd.git [Minor] Fix a corner case --- diff --git a/src/libutil/upstream.c b/src/libutil/upstream.c index 37918dd48b..d22e71354a 100644 --- a/src/libutil/upstream.c +++ b/src/libutil/upstream.c @@ -664,7 +664,7 @@ rspamd_upstream_resolve_addrs (const struct upstream_list *ls, char dns_name[253 + 1]; /* 253 == max dns name + \0 */ const char *semicolon_pos = strchr(upstream->name, ':'); - if (semicolon_pos != NULL) { + 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); }