Skip to content

Commit

Permalink
lib: fix xml_escape(), again
Browse files Browse the repository at this point in the history
Commit ff0b8d0 (fix CDATA escaping) introduced two bugs to xml_escape():

- it eats ']' characters that are not part of ']]>'
- it eats the next character after ']]>'

Fixes #2809
  • Loading branch information
JuhaSointusalo committed Nov 10, 2018
1 parent e72c05a commit 5e23a94
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,9 @@ void xml_escape(const char* in, char* out, int len) {
if (!strncmp(in, "]]>", 3)) {
strcpy(p, "]]>");
p += 6;
in += 3;
in += 2; // +1 from for loop
} else {
*p++ = x;
}
} else {
*p++ = x;
Expand Down

0 comments on commit 5e23a94

Please sign in to comment.