Merge pull request #6930 from JoltedJon/utf8-decode-fix

Fix UTF-8 decode error check
This commit is contained in:
Jeroen van Rijn
2026-07-02 12:03:26 +02:00
committed by GitHub

View File

@@ -127,7 +127,7 @@ gb_internal isize utf8_decode(u8 const *str, isize str_len, Rune *codepoint_out)
sz = x&7;
accept = global__utf8_accept_ranges[x>>4];
if (str_len < gb_size_of(sz))
if (str_len < sz)
goto invalid_codepoint;
b1 = str[1];