commit 68d7684: [Minor] Fix crash when tld is absent

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Mar 4 20:21:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-03-04 20:06:13 +0000
URL: https://github.com/rspamd/rspamd/commit/68d76845eea77ec5d4665d9a31fe66deca7b6d0b

[Minor] Fix crash when tld is absent

---
 src/libserver/html.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/libserver/html.c b/src/libserver/html.c
index 47d8ec836..7da18cdfe 100644
--- a/src/libserver/html.c
+++ b/src/libserver/html.c
@@ -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;


More information about the Commits mailing list