]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Do not check empty html components
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 15 Mar 2016 17:04:25 +0000 (17:04 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 15 Mar 2016 17:04:25 +0000 (17:04 +0000)
src/libserver/html.c

index a910520c50a05beafc97489bc0f752ebb6f32987..b799e9280c029273cc81a5e9fcea5cb3fcbd101a 100644 (file)
@@ -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) {