]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Fix off-boundary access
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 10 Nov 2017 18:51:57 +0000 (18:51 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 10 Nov 2017 18:51:57 +0000 (18:51 +0000)
src/libserver/html.c

index 42b2447e0beb19801e8f5b0891250bb65fb47564..8ff6b6fad78c7b1e332f979fd72117357baf27ce 100644 (file)
@@ -2076,6 +2076,11 @@ rspamd_html_check_displayed_url (rspamd_mempool_t *pool,
        gboolean url_found = FALSE;
        struct rspamd_process_exception *ex;
 
+       if (href_offset <= 0) {
+               /* No dispalyed url, just some text within <a> tag */
+               return;
+       }
+
        rspamd_html_url_is_phished (pool, url,
                        dest->data + href_offset,
                        dest->len - href_offset,