From e6c6699c9401ea6c4b7cfa1967681b1e9f0eb7ae Mon Sep 17 00:00:00 2001 From: Jun Tajima <56220423+tjmprm77@users.noreply.github.com> Date: Mon, 2 May 2022 19:57:21 +0900 Subject: [PATCH] Fix an issue where WinMerge crashes depending on the filename when generating a file compare report. (#1319) - Fix to properly resize the buffer of the replaced character string in the process of replacing the special characters contained in the file name with the HTML entities. --- Src/markdown.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/markdown.cpp b/Src/markdown.cpp index 1037294ca1d..0b68c07d08f 100644 --- a/Src/markdown.cpp +++ b/Src/markdown.cpp @@ -208,7 +208,7 @@ std::string CMarkdown::Entities(const std::string& v) { ptrdiff_t i = p - &ret[0]; ptrdiff_t j = q - &ret[0]; - size_t b = v.length(); + size_t b = ret.length(); ret.resize(b + cchValue - 1); p = &ret[0] + i; q = &ret[0] + j;