diff options
author | Mattias Andrée <maandree@kth.se> | 2021-04-17 13:34:19 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-04-17 13:34:19 +0200 |
commit | 8b1ebd2d10413896e15f75071e96250189e58600 (patch) | |
tree | ab5dc2a7324cc05f54280c6c46e1cbbb9b7f05a5 | |
parent | Add dynamically linked version of library (diff) | |
download | libparser-8b1ebd2d10413896e15f75071e96250189e58600.tar.gz libparser-8b1ebd2d10413896e15f75071e96250189e58600.tar.bz2 libparser-8b1ebd2d10413896e15f75071e96250189e58600.tar.xz |
Fix surrogate rejection
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r-- | libparser-generate.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |