Sat, 25 Jan 2025 16:27:32 +0100
fix incorrect str length comparision in unescape_string
src/json.c | file | annotate | diff | comparison | revisions |
--- a/src/json.c Sat Jan 25 16:13:28 2025 +0100 +++ b/src/json.c Sat Jan 25 16:27:32 2025 +0100 @@ -399,7 +399,7 @@ } else if (c == 'b') { c = '\b'; } else if (c == 'u') { - if (i+4 < str.length) { + if (i+4 < str.length - 1) { cxstring codepoint_str = { str.ptr + i + 1, 4}; uint32_t codepoint; if(!cx_strtou32_lc_(codepoint_str, &codepoint, 16, "")) {