3 ms·
The code is careful not to read past the end of the buffer, but it doesn't explicitly check that there are enough bytes available for the current multibyte char
by masfuerte 2y ago
The code is careful not to read past the end of the buffer, but it doesn't explicitly check that there are enough bytes available for the current multibyte character. However, this "end of buffer in middle of character" error is caught later by the check for valid continuation bytes. I thought that was quite neat.