Fix UBSan error

This commit is contained in:
Alexey Milovidov 2020-08-06 04:59:02 +03:00
parent a92438eff2
commit 8fd4038234
3 changed files with 5 additions and 1 deletions

View File

@ -42,7 +42,7 @@ inline void syncForward(const UInt8 * & s, const UInt8 * const end)
/// returns UTF-8 code point sequence length judging by it's first octet
inline size_t seqLength(const UInt8 first_octet)
{
if (first_octet < 0x80u)
if (first_octet < 0x80 || first_octet >= 0xF8) /// The specs of UTF-8.
return 1;
const size_t bits = 8;

View File

@ -0,0 +1,2 @@
FF
FF

View File

@ -0,0 +1,2 @@
SELECT hex(lowerUTF8('\xFF'));
SELECT hex(upperUTF8('\xFF'));