summaryrefslogtreecommitdiff
path: root/utf8proc.c
diff options
context:
space:
mode:
authorMichaël Meyer <hierophanie@gmail.com>2016-02-04 04:01:19 +0100
committerMichaël Meyer <hierophanie@gmail.com>2016-02-04 04:06:28 +0100
commit1f17487aa952a11f2ac53481b26b5a25b9a2fccc (patch)
treecec3e05eb7b416717edf22fa5f8c301fc8df7c77 /utf8proc.c
parentec0daa50bbedc36a0bada4a0f713eb9dc317d444 (diff)
downloadlibutf8proc-1f17487aa952a11f2ac53481b26b5a25b9a2fccc.tar.gz
libutf8proc-1f17487aa952a11f2ac53481b26b5a25b9a2fccc.tar.bz2
Fix overrun
Diffstat (limited to 'utf8proc.c')
-rw-r--r--utf8proc.c2
1 files changed, 1 insertions, 1 deletions
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;
}