]> granicus.if.org Git - multimarkdown/commitdiff
FIXED: Fix crash in reference definitions
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Sat, 18 Mar 2017 12:35:25 +0000 (08:35 -0400)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Sat, 18 Mar 2017 12:35:25 +0000 (08:35 -0400)
Sources/libMultiMarkdown/writer.c

index 2e75fc8262bc53e6a7d99fe7924a4b1895784c4e..f562fcdf9d11cc738b022357a7adb2bf4ae916be 100644 (file)
@@ -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;