From c609cddaa4f3d71f96639e11b82037f16565acea Mon Sep 17 00:00:00 2001 From: "Fletcher T. Penney" Date: Tue, 14 Mar 2017 13:51:44 -0400 Subject: [PATCH] FIXED: Fix potential crash in attribute parsing --- Sources/libMultiMarkdown/writer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/libMultiMarkdown/writer.c b/Sources/libMultiMarkdown/writer.c index 853d355..fc8e27b 100644 --- a/Sources/libMultiMarkdown/writer.c +++ b/Sources/libMultiMarkdown/writer.c @@ -532,7 +532,7 @@ attr * parse_attributes(char * source) { size_t scan_len; size_t pos = 0; - while (scan_attr(&source[pos])) { + while (source[pos] != '\0' && scan_attr(&source[pos])) { pos += scan_spnl(&source[pos]); // Get key @@ -556,7 +556,7 @@ attr * parse_attributes(char * source) { attributes = a; } - free(value); // We stored a copy + free(value); // We stored a modified copy } return attributes; -- 2.50.1