From 0d89d51e9f280b36554e8f9bc66217e1d6f845c4 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 12 Nov 2022 15:53:29 +0000 Subject: [PATCH] [Minor] Add a simple check when trying to parse urls on config stage --- src/libserver/url.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libserver/url.c b/src/libserver/url.c index 8378c1637..932cd9e85 100644 --- a/src/libserver/url.c +++ b/src/libserver/url.c @@ -3627,6 +3627,15 @@ rspamd_url_find_single (rspamd_mempool_t *pool, inlen = strlen (in); } + /* + * We might have a situation when we need to parse URLs on config file + * parsing, but there is no valid url_scanner loaded. Hence, we just load + * some defaults and it should be fine... + */ + if (url_scanner == NULL) { + rspamd_url_init (NULL); + } + memset (&cb, 0, sizeof (cb)); cb.begin = in; cb.end = in + inlen; -- 2.39.5