From a85ca00a55ed004a23c8456924e18dcc8389ab21 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Tue, 4 Sep 2018 20:48:42 -0300 Subject: [PATCH] Fix utf-8 character encoding conversion Reported on: #1794 --- CHANGES | 2 ++ src/operators/validate_utf8_encoding.cc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 392c18f1..c15bb72d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ v3.0.3 - YYYY-MMM-DD (to be released) ------------------------------------- + - Fix utf-8 character encoding conversion + [Issue #1794 - @tinselcity, @zimmerle] - Adds support for ctl:requestBodyProcessor=URLENCODED [Issue #1797 - @victorhora] - Add LUA compatibility for CentOS and try to use LuaJIT first if available diff --git a/src/operators/validate_utf8_encoding.cc b/src/operators/validate_utf8_encoding.cc index c3b7896a..2e917787 100644 --- a/src/operators/validate_utf8_encoding.cc +++ b/src/operators/validate_utf8_encoding.cc @@ -86,7 +86,7 @@ int ValidateUtf8Encoding::detect_utf8_character( unicode_len = 4; /* compute character number */ d = ((c & 0x07) << 18) | ((*(p_read + 1) & 0x3F) << 12) - | ((*(p_read + 2) & 0x3F) < 6) | (*(p_read + 3) & 0x3F); + | ((*(p_read + 2) & 0x3F) << 6) | (*(p_read + 3) & 0x3F); } } else { /* any other first byte is invalid (RFC 3629) */