From 739048749e11eeb2344151ef2412106362ad494b Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Tue, 4 Sep 2018 21:00:26 -0300 Subject: [PATCH] Fix utf-8 character encoding conversion Reported on: #1794 --- CHANGES | 2 ++ apache2/re_operators.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 30d0ea54..0650fa93 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ DD MMM YYYY - 2.9.3 - To be released ------------------------------------ + * Fix utf-8 character encoding conversion + [Issue #1794 - @tinselcity, @zimmerle] * Fix ip tree lookup on netmask content [Issue #1793 - @tinselcity, @zimmerle] * IIS: set overrideModeDefault to Allow so that individual websites can diff --git a/apache2/re_operators.c b/apache2/re_operators.c index b6d1c03c..e0fc6fa8 100644 --- a/apache2/re_operators.c +++ b/apache2/re_operators.c @@ -4321,7 +4321,7 @@ static int detect_utf8_character(const unsigned char *p_read, unsigned int lengt else { unicode_len = 4; /* compute character number */ - d = ((c & 0x07) << 18) | ((*(p_read + 1) & 0x3F) << 12) | ((*(p_read + 2) & 0x3F) < 6) | (*(p_read + 3) & 0x3F); + d = ((c & 0x07) << 18) | ((*(p_read + 1) & 0x3F) << 12) | ((*(p_read + 2) & 0x3F) << 6) | (*(p_read + 3) & 0x3F); } } /* any other first byte is invalid (RFC 3629) */