From 0182de6d186735bd1cee91d2de21318e82acae8b Mon Sep 17 00:00:00 2001 From: Virtually Nick Date: Mon, 17 May 2021 14:14:48 -0400 Subject: [PATCH] GUACAMOLE-1215: Add backslash to list of JSON-escaped characters. --- src/common/json.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/json.c b/src/common/json.c index 6dad60be..0d2cb0b4 100644 --- a/src/common/json.c +++ b/src/common/json.c @@ -97,15 +97,15 @@ int guac_common_json_write_string(guac_user* user, const char* current = str; for (; *current != '\0'; current++) { - /* Escape all quotes */ - if (*current == '"') { + /* Escape all quotes and back-slashes */ + if (*current == '"' || *current == '\\') { /* Write any string content up to current character */ if (current != str) blob_written |= guac_common_json_write(user, stream, json_state, str, current - str); - /* Escape the quote that was just read */ + /* Escape the character that was just read */ blob_written |= guac_common_json_write(user, stream, json_state, "\\", 1);