Fix bug in check_utf8() where it would allow all C0 control codes other than LF

This commit is contained in:
Juhani Krekelä 2019-07-15 00:30:53 +03:00
parent 114d595ed2
commit 579550468c
1 changed files with 1 additions and 1 deletions

View File

@ -589,7 +589,7 @@ bool check_utf8(const unsigned char *data, size_t data_length, bool newline_allo
// Reject control characters
if (codepoint <= 0x1f) {
// C0 control character
if (!newline_allowed || codepoint == 0x0a) {
if (!newline_allowed || codepoint != 0x0a) {
return false;
}
} else if (0x80 <= codepoint && codepoint <= 0x9f) {