]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix crash when tld is absent
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 4 Mar 2019 20:06:13 +0000 (20:06 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 4 Mar 2019 20:06:13 +0000 (20:06 +0000)
src/libserver/html.c

index 47d8ec8368a814ca4ece1a1838d108cdb2643737..7da18cdfea304d656a50c958ab9b8771f1ae45ff 100644 (file)
@@ -664,7 +664,8 @@ rspamd_html_url_is_phished (rspamd_mempool_t *pool,
                                }
                        }
 #endif
-                       if (rspamd_ftok_casecmp (&disp_tok, &href_tok) != 0) {
+                       if (rspamd_ftok_casecmp (&disp_tok, &href_tok) != 0 &&
+                                       text_url->tldlen > 0 && href_url->tldlen > 0) {
 
                                /* Apply the same logic for TLD */
                                disp_tok.len = text_url->tldlen;