From ace44328a47be6dee04d2a054e97c39a3aef2667 Mon Sep 17 00:00:00 2001 From: Dj Padzensky Date: Jun 18 2018 18:21:37 +0000 Subject: Fixing 4-byte UTF-8 character validation (cherry picked from commit 2707e39868c16275aa070102f2fda6047632354a) --- diff --git a/ldap/servers/plugins/syntaxes/validate.c b/ldap/servers/plugins/syntaxes/validate.c index 371ab32..bea0ba4 100644 --- a/ldap/servers/plugins/syntaxes/validate.c +++ b/ldap/servers/plugins/syntaxes/validate.c @@ -241,12 +241,14 @@ utf8char_validate( * the second byte. */ if (*p == '\xF0') { /* The next byte must be %x90-BF. */ + p++; if (((unsigned char)*p < (unsigned char)'\x90') || ((unsigned char)*p > (unsigned char)'\xBF')) { rc = 1; goto exit; } } else if (*p == '\xF4') { /* The next byte must be %x80-BF. */ + p++; if (((unsigned char)*p < (unsigned char)'\x80') || ((unsigned char)*p > (unsigned char)'\xBF')) { rc = 1; goto exit;