From 629d2c0e83d1a9110f82d82c31f9197cece520ff Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Fri, 20 Aug 2021 23:10:46 -0700 Subject: utf: Add missing return for invalid UTF-8 --- utf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utf.c b/utf.c index e399e99..b012184 100644 --- a/utf.c +++ b/utf.c @@ -51,6 +51,8 @@ utf8dec(const char *s, size_t n, uint_least32_t *c) } else if ((b & 0xf8) == 0xf0) { x = b & 0x07; l = 4; + } else { + return -1; } if (n < l) return -1; -- cgit v1.2.3