FIXED: Fix two potential crashes
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Mon, 3 Jul 2017 11:46:25 +0000 (07:46 -0400)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Mon, 3 Jul 2017 11:46:25 +0000 (07:46 -0400)
Sources/libMultiMarkdown/mmd.c

index a493d8ecc6c8e4ba58c4037b66f243eee1d4f060..b6a3ef3c9e7c7f26b56ca3a202a58b507a9b6951 100644 (file)
@@ -1503,7 +1503,8 @@ void recursive_parse_list_item(mmd_engine * e, token * block) {
 
        // Insert marker back in place
        marker->next = block->child->child;
-       block->child->child->prev = marker;
+       if (block->child->child)
+               block->child->child->prev = marker;
        block->child->child = marker;
 }
 
@@ -1532,6 +1533,9 @@ void is_list_loose(token * list) {
        
        token * walker = list->child;
 
+       if (walker == NULL)
+               return;
+
        while (walker->next != NULL) {
                if (walker->type == BLOCK_LIST_ITEM) {
                        if (walker->child->type == BLOCK_PARA) {