From: Fletcher T. Penney Date: Sun, 12 Nov 2017 13:46:55 +0000 (-0500) Subject: FIXED: Prevent pointer overflow X-Git-Tag: 6.2.3^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=58b7a615acd5f687675aa6dd471ae4984c137027;p=multimarkdown FIXED: Prevent pointer overflow --- diff --git a/Sources/libMultiMarkdown/transclude.c b/Sources/libMultiMarkdown/transclude.c index c828e47..3321a7a 100644 --- a/Sources/libMultiMarkdown/transclude.c +++ b/Sources/libMultiMarkdown/transclude.c @@ -144,7 +144,7 @@ void add_trailing_sep(DString * path) { #endif // Ensure that folder ends in separator - if (!is_separator(path->str[path->currentStringLength - 1])) { + if ((path->currentStringLength == 0) || (!is_separator(path->str[path->currentStringLength - 1]))) { d_string_append_c(path, sep); } }