aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2021-08-20 23:10:46 -0700
committerMichael Forney <mforney@mforney.org>2021-08-20 23:10:46 -0700
commit629d2c0e83d1a9110f82d82c31f9197cece520ff (patch)
treedc22fb352112e68d0b97f29080cd429df89079a3
parent1554ecc9334373257b7b3a72971cf25a1179ec16 (diff)
downloadcproc-629d2c0e83d1a9110f82d82c31f9197cece520ff.tar.xz
utf: Add missing return for invalid UTF-8
-rw-r--r--utf.c2
1 files changed, 2 insertions, 0 deletions
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;