From 0da972149adb8a4c4f0c00b0011f27ae29614722 Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Thu, 19 Mar 2026 02:38:55 +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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tinygltf_json.h b/tinygltf_json.h index f39bc19..5c1e8dc 100644 --- a/tinygltf_json.h +++ b/tinygltf_json.h @@ -480,8 +480,9 @@ static char *cj_unescape_string(const char *p, const char *str_end, break; } default: - *dst++ = (char)esc; - break; + /* Unknown escape sequence is invalid in JSON */ + free(out); + return NULL; } } else if (c < 0x20u) { ++p; /* skip invalid control char */