fix(yaml): Properly escape double quotes (#3965)

This commit is contained in:
Raphael Coeffic
2023-11-13 09:34:44 +10:00
committed by GitHub
parent bd2d11ef8b
commit 0e7fe7f143
4 changed files with 84 additions and 7 deletions
-4
View File
@@ -285,10 +285,6 @@ YamlParser::parse(const char* buffer, unsigned int size)
state = ps_CRLF;
continue;
}
if (*c == '\"') {
state = ps_ValQuo;
break;
}
if (*c == '\\') {
state = ps_ValEsc;
break;
+2 -2
View File
@@ -117,9 +117,9 @@ static bool yaml_output_string(const char* str, uint32_t max_len,
{
if (!wf(opaque, "\"", 1))
return false;
while(max_len > 0 && *str) {
if (*str >= 0x20 && *str <= 0x7E) {
if (*str >= 0x20 && *str <= 0x7E && *str != '"') {
if (!wf(opaque, str++, 1)) return false;
max_len--;
}