aboutsummaryrefslogtreecommitdiff
path: root/liberty.c
diff options
context:
space:
mode:
Diffstat (limited to 'liberty.c')
-rw-r--r--liberty.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/liberty.c b/liberty.c
index 3aadc29..c0b6bb4 100644
--- a/liberty.c
+++ b/liberty.c
@@ -2753,6 +2753,11 @@ utf8_decode (const char **s, size_t len)
// Check the rest of the sequence
uint32_t cp = *p++ & ~mask;
+
+ // Overlong sequence (possibly MUTF-8, not supported)
+ if (!cp && sequence_len)
+ return -1;
+
while (sequence_len && --sequence_len)
{
if (p == end)