OSDN Git Service

Fix an issue where WinMerge crashes depending on the filename when generating a file...
authorJun Tajima <56220423+tjmprm77@users.noreply.github.com>
Mon, 2 May 2022 10:57:21 +0000 (19:57 +0900)
committerGitHub <noreply@github.com>
Mon, 2 May 2022 10:57:21 +0000 (19:57 +0900)
- 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

index 1037294..0b68c07 100644 (file)
@@ -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;