aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libserver/html.c4
1 files 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) {