Fix crash on 'srcset' inline URIs

* src/html-url.c (tag_handle_img): Check append_url() for NULL
  return value before dereference.

Crashed reproducable with parsing srcset="data:..." inline data.
Reported-by: Coverity
This commit is contained in:
Tim Rühsen 2016-09-09 11:44:02 +02:00
parent 40870e1271
commit a2c4849900

View File

@ -729,8 +729,11 @@ tag_handle_img (int tagid, struct taginfo *tag, struct map_context *ctx) {
srcset + url_end);
struct urlpos *up = append_url (url_text, base_ind + url_start,
url_end - url_start, ctx);
up->link_inline_p = 1;
up->link_noquote_html_p = 1;
if (up)
{
up->link_inline_p = 1;
up->link_noquote_html_p = 1;
}
xfree (url_text);
}