mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Fix UBSan error
This commit is contained in:
parent
a92438eff2
commit
8fd4038234
@ -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;
|
||||
|
2
tests/queries/0_stateless/01431_utf8_ubsan.reference
Normal file
2
tests/queries/0_stateless/01431_utf8_ubsan.reference
Normal file
@ -0,0 +1,2 @@
|
||||
FF
|
||||
FF
|
2
tests/queries/0_stateless/01431_utf8_ubsan.sql
Normal file
2
tests/queries/0_stateless/01431_utf8_ubsan.sql
Normal file
@ -0,0 +1,2 @@
|
||||
SELECT hex(lowerUTF8('\xFF'));
|
||||
SELECT hex(upperUTF8('\xFF'));
|
Loading…
Reference in New Issue
Block a user