Skip to content

Commit cb49f31

Browse files
committed
deps: cherry-pick libuv/libuv@d09441c
Original commit message: fs: fix WTF-8 decoding issue (#4092) We forgot to mask off the high bits from the first byte, so we ended up always failing the subsequent range check. Refs: libuv/libuv#2970 Fixes: #48673 PR-URL: #51976 Refs: #48673 Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Ulises Gascón <[email protected]>
1 parent ea50540 commit cb49f31

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

deps/uv/src/win/fs.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,11 @@ static int32_t fs__decode_wtf8_char(const char** input) {
176176
if ((b4 & 0xC0) != 0x80)
177177
return -1; /* invalid: not a continuation byte */
178178
code_point = (code_point << 6) | (b4 & 0x3F);
179-
if (b1 <= 0xF4)
179+
if (b1 <= 0xF4) {
180+
code_point &= 0x1FFFFF;
180181
if (code_point <= 0x10FFFF)
181182
return code_point; /* four-byte character */
183+
}
182184

183185
/* code point too large */
184186
return -1;

0 commit comments

Comments
 (0)