Merge pull request #23763 from neovim/backport-23760-to-release-0.9

[Backport release-0.9] fix(mkspell): prevent Unicode character overflow
This commit is contained in:
zeertzjq
2023-05-26 12:26:21 +08:00
committed by GitHub

View File

@@ -3127,7 +3127,7 @@ static int spell_read_dic(spellinfo_T *spin, char *fname, afffile_T *affile)
// Remove CR, LF and white space from the end. White space halfway through
// the word is kept to allow multi-word terms like "et al.".
l = (int)strlen(line);
while (l > 0 && line[l - 1] <= ' ') {
while (l > 0 && (uint8_t)line[l - 1] <= ' ') {
l--;
}
if (l == 0) {