From 1f17487aa952a11f2ac53481b26b5a25b9a2fccc Mon Sep 17 00:00:00 2001 From: Michaƫl Meyer Date: Thu, 4 Feb 2016 04:01:19 +0100 Subject: Fix overrun --- utf8proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utf8proc.c') diff --git a/utf8proc.c b/utf8proc.c index ab23a87..dc1000a 100644 --- a/utf8proc.c +++ b/utf8proc.c @@ -128,7 +128,7 @@ UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_iterate( if ((uc - 0xc2) > (0xf4-0xc2)) return UTF8PROC_ERROR_INVALIDUTF8; if (uc < 0xe0) { // 2-byte sequence // Must have valid continuation character - if (!utf_cont(*str)) return UTF8PROC_ERROR_INVALIDUTF8; + if (str >= end || !utf_cont(*str)) return UTF8PROC_ERROR_INVALIDUTF8; *dst = ((uc & 0x1f)<<6) | (*str & 0x3f); return 2; } -- cgit v1.2.3