From 5ff65a47686854b082fca1fbb7b64e11e9a47e3f Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Wed, 3 Jul 2019 11:02:20 +0200 Subject: [PATCH] Fix a crash in litehtml plugin if one of the MIME parts has no Content-ID --- src/plugins/litehtml_viewer/lh_widget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/litehtml_viewer/lh_widget.cpp b/src/plugins/litehtml_viewer/lh_widget.cpp index 7f87b0d4d..fb2d2a640 100644 --- a/src/plugins/litehtml_viewer/lh_widget.cpp +++ b/src/plugins/litehtml_viewer/lh_widget.cpp @@ -447,8 +447,9 @@ GdkPixbuf *lh_widget::get_local_image(const litehtml::tstring url) const size_t len = strlen(name); /* p->id is in format "" */ - if (!strncasecmp(name, p->id + 1, len) && + if (p->id != NULL && strlen(p->id) >= len + 2 && + !strncasecmp(name, p->id + 1, len) && *(p->id + len + 1) == '>') { GInputStream *stream; GError *error = NULL; -- 2.25.1