Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Syoyo Fujita
2026-03-19 02:38:40 +09:00
committed by GitHub
parent 690585fa73
commit eb087e80e7

View File

@@ -1280,10 +1280,13 @@ static void cj_parse_string_to(cj_parse_ctx *ctx, char **out_str,
*out_str = cj_unescape_string(ctx->cur, scan, out_len);
if (!*out_str) { cj_ctx_error(ctx, "string unescape failed"); }
ctx->cur = scan + 1;
*out_len = len;
return;
}
/* Control char (< 0x20) - skip */
++p;
/* Control char (< 0x20) - treat as parse error (invalid JSON) */
cj_ctx_error(ctx, "invalid control character in string");
*out_str = NULL; *out_len = 0;
return;
}
cj_ctx_error(ctx, "unterminated string");
*out_str = NULL; *out_len = 0;