From 15d7b4047d2b343ab4d06a6d47550fc1d2bc52ad Mon Sep 17 00:00:00 2001 From: "Fletcher T. Penney" Date: Sat, 18 Mar 2017 08:35:25 -0400 Subject: [PATCH] FIXED: Fix crash in reference definitions --- Sources/libMultiMarkdown/writer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/libMultiMarkdown/writer.c b/Sources/libMultiMarkdown/writer.c index 2e75fc8..f562fcd 100644 --- a/Sources/libMultiMarkdown/writer.c +++ b/Sources/libMultiMarkdown/writer.c @@ -1277,7 +1277,9 @@ void process_definition_block(mmd_engine * e, token * block) { // Adjust the properties free(f->label_text); f->label_text = f->clean_text; - if (f->content->child->next->next) { + if (f->content->child && + f->content->child->next && + f->content->child->next->next) { f->clean_text = clean_string_from_range(e->dstr->str, f->content->child->next->next->start, block->start + block->len - f->content->child->next->next->start, false); } else { f->clean_text = NULL; -- 2.50.1