]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Add a simple check when trying to parse urls on config stage
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 12 Nov 2022 15:53:29 +0000 (15:53 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 12 Nov 2022 21:52:48 +0000 (21:52 +0000)
src/libserver/url.c

index 8378c1637ea79917cdd869c9d317474243ee5545..932cd9e853b6d0cb3e6401dbae4a085dd25de256 100644 (file)
@@ -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;