mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 22:48:34 +00:00
fix(fileio): replace characters over INT_MAX with U+FFFD (#16354)
fixes #11877 credit: @zubairabid https://github.com/neovim/neovim/pull/12010
This commit is contained in:
@@ -1360,6 +1360,10 @@ retry:
|
||||
u8c += (unsigned)(*--p) << 16;
|
||||
u8c += (unsigned)(*--p) << 24;
|
||||
}
|
||||
// Replace characters over INT_MAX with Unicode replacement character
|
||||
if (u8c > INT_MAX) {
|
||||
u8c = 0xfffd;
|
||||
}
|
||||
} else { // UTF-8
|
||||
if (*--p < 0x80) {
|
||||
u8c = *p;
|
||||
|
Reference in New Issue
Block a user