From: Fletcher T. Penney Date: Sat, 18 Mar 2017 12:35:25 +0000 (-0400) Subject: FIXED: Fix crash in reference definitions X-Git-Tag: 6.0.0-rc2^2~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=15d7b4047d2b343ab4d06a6d47550fc1d2bc52ad;p=multimarkdown FIXED: Fix crash in reference definitions --- 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;