From: Jaroslav Kysela Date: Sat, 2 Apr 2016 08:07:38 +0000 (+0200) Subject: markdown: fix NULL pointer dereference crash X-Git-Tag: v4.2.1~759 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0c7b35178c907b52fa2140a6c138a1f910bc1c6;p=thirdparty%2Ftvheadend.git markdown: fix NULL pointer dereference crash --- diff --git a/src/webui/doc_md.c b/src/webui/doc_md.c index d0dacb483..22d20ab39 100644 --- a/src/webui/doc_md.c +++ b/src/webui/doc_md.c @@ -146,11 +146,13 @@ http_markdown_class(http_connection_t *hc, const char *clazz) md_header(hq, "##", s); nl = md_nl(hq, 1); } - for (; *doc; doc++) { - if (*doc[0] == '\xff') { - htsbuf_append_str(hq, tvh_gettext_lang(lang, *doc + 1)); - } else { - htsbuf_append_str(hq, *doc); + if (doc) { + for (; *doc; doc++) { + if (*doc[0] == '\xff') { + htsbuf_append_str(hq, tvh_gettext_lang(lang, *doc + 1)); + } else { + htsbuf_append_str(hq, *doc); + } } } l = htsmsg_get_list(m, "props");