# HG changeset patch # User Olaf Wintermann # Date 1737818852 -3600 # Node ID 7b0bd5e76b5d958182c089fe58fd0d372cff7461 # Parent df5665de7344512334b493c085243de793181fb1 fix incorrect str length comparision in unescape_string diff -r df5665de7344 -r 7b0bd5e76b5d src/json.c --- 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, "")) {