From: Vsevolod Stakhov Date: Sat, 12 Nov 2022 15:53:29 +0000 (+0000) Subject: [Minor] Add a simple check when trying to parse urls on config stage X-Git-Tag: 3.5~214 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0d89d51e9f280b36554e8f9bc66217e1d6f845c4;p=thirdparty%2Frspamd.git [Minor] Add a simple check when trying to parse urls on config stage --- diff --git a/src/libserver/url.c b/src/libserver/url.c index 8378c1637e..932cd9e853 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;