aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/upstream.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2022-02-07 22:08:29 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2022-02-07 22:08:29 +0000
commit7bf24f093da9151b8b8887fd40b64a51d1116437 (patch)
treef8a8bb1f97dc9af1c10484ffe9d43d35fe928c67 /src/libutil/upstream.c
parent3ea9cf43a9b034a3401ab84bd289ee783da0bfed (diff)
downloadrspamd-7bf24f093da9151b8b8887fd40b64a51d1116437.tar.gz
rspamd-7bf24f093da9151b8b8887fd40b64a51d1116437.zip
[Minor] Fix a corner case
Diffstat (limited to 'src/libutil/upstream.c')
-rw-r--r--src/libutil/upstream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libutil/upstream.c b/src/libutil/upstream.c
index 37918dd48..d22e71354 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);
}