From: Vsevolod Stakhov Date: Tue, 15 Mar 2016 17:04:25 +0000 (+0000) Subject: [Fix] Do not check empty html components X-Git-Tag: 1.2.0~35 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=747ae55cb67a3951a19d4ed7ea13f9efc4ce74ce;p=rspamd.git [Fix] Do not check empty html components --- 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) {