From 8b1ebd2d10413896e15f75071e96250189e58600 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 17 Apr 2021 13:34:19 +0200 Subject: Fix surrogate rejection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libparser-generate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libparser-generate.c b/libparser-generate.c index cc03972..ef2177c 100644 --- a/libparser-generate.c +++ b/libparser-generate.c @@ -138,7 +138,7 @@ check_utf8(char *buf, size_t *ip, size_t len) cp |= (uint32_t)(unsigned char)(buf[*ip + i] ^ 0x80); } *ip += req; - if ((cp & UINT32_C(0xD8000)) == UINT32_C(0xD8000)) + if ((cp & UINT32_C(0xFFF8000)) == UINT32_C(0xD8000)) return 0; if (cp < (uint32_t)1 << (7 + 0 * 6)) return 0; -- cgit v1.2.3-70-g09d2