From 0ab7e7493330e4efa5be96ff16aca9c9ed228d9e Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Thu, 19 Mar 2026 02:39:13 +0900 Subject: [PATCH] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- tinygltf_json.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tinygltf_json.h b/tinygltf_json.h index 5c1e8dc..c4ad84b 100644 --- a/tinygltf_json.h +++ b/tinygltf_json.h @@ -485,7 +485,9 @@ static char *cj_unescape_string(const char *p, const char *str_end, return NULL; } } else if (c < 0x20u) { - ++p; /* skip invalid control char */ + /* Invalid unescaped control character in JSON string: treat as error */ + free(out); + return NULL; } else { /* Should not be reached since scan_str stops here only for special chars - but guard just in case */