]> granicus.if.org Git - multimarkdown/commitdiff
FIXED: Fix potential dereference in table handling
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Thu, 7 Sep 2017 15:35:38 +0000 (11:35 -0400)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Thu, 7 Sep 2017 15:35:38 +0000 (11:35 -0400)
Sources/libMultiMarkdown/writer.c

index da9e8e5eac079567a4eb7a916a9a5c40d4b7d85d..ed0bbf7cc931dc3d3cb2b83b92885313df9f74de 100644 (file)
@@ -2354,6 +2354,13 @@ void abbreviation_from_bracket(const char * source, scratch_pad * scratch, token
 void read_table_column_alignments(const char * source, token * table, scratch_pad * scratch) {
        token * walker = table->child->child;
 
+       scratch->table_alignment[0] = '\0';
+       scratch->table_column_count = 0;
+
+       if (walker == NULL) {
+               return;
+       }
+
        // Find the separator line
        while (walker->next) {
                walker = walker->next;