From 579550468cba65770a28c5bf13fd6a23dd9afabd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Mon, 15 Jul 2019 00:30:53 +0300 Subject: [PATCH] Fix bug in check_utf8() where it would allow all C0 control codes other than LF --- ethermess-backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethermess-backend.c b/ethermess-backend.c index 812ddf1..a28677d 100644 --- a/ethermess-backend.c +++ b/ethermess-backend.c @@ -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) {