From 747ae55cb67a3951a19d4ed7ea13f9efc4ce74ce Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 15 Mar 2016 17:04:25 +0000 Subject: [PATCH] [Fix] Do not check empty html components --- src/libserver/html.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libserver/html.c b/src/libserver/html.c index a910520c5..b799e9280 100644 --- a/src/libserver/html.c +++ b/src/libserver/html.c @@ -1297,7 +1297,7 @@ rspamd_html_process_img_tag (rspamd_mempool_t *pool, struct html_tag *tag, } else if (comp->type == RSPAMD_HTML_COMPONENT_STYLE) { /* Try to search for height= or width= in style tag */ - if (!seen_height) { + if (!seen_height && comp->len > 0) { p = rspamd_strncasestr (comp->start, "height", comp->len); if (p != NULL) { @@ -1318,7 +1318,7 @@ rspamd_html_process_img_tag (rspamd_mempool_t *pool, struct html_tag *tag, } } - if (!seen_width) { + if (!seen_width && comp->len > 0) { p = rspamd_strncasestr (comp->start, "width", comp->len); if (p != NULL) { -- 2.39.5