diff --git a/cJSON.c b/cJSON.c index 88c2d95b..d24d5984 100644 --- a/cJSON.c +++ b/cJSON.c @@ -2913,7 +2913,7 @@ static void minify_string(char **input, char **output) { *input += static_strlen("\""); *output += static_strlen("\""); return; - } else if (((*input)[0] == '\\') && ((*input)[1] == '\"')) { + } else if (((*input)[0] == '\\') && ((*input)[1] != '\0')) { (*output)[1] = (*input)[1]; *input += static_strlen("\""); *output += static_strlen("\""); diff --git a/cJSON_Utils.c b/cJSON_Utils.c index 8fa24f8e..233799f1 100644 --- a/cJSON_Utils.c +++ b/cJSON_Utils.c @@ -374,7 +374,7 @@ static void decode_pointer_inplace(unsigned char *string) } else if (string[1] == '1') { - decoded_string[1] = '/'; + decoded_string[0] = '/'; } else { @@ -384,6 +384,10 @@ static void decode_pointer_inplace(unsigned char *string) string++; } + else + { + decoded_string[0] = string[0]; + } } decoded_string[0] = '\0';