From 21e25d18295e5dfaf170051cd1c84e51eb88812d Mon Sep 17 00:00:00 2001 From: Noah Metzger Date: Tue, 17 Apr 2018 16:30:03 +0200 Subject: [PATCH] Fixed a memory corruption, detected by Coverity CID 1385632 Out-of-bounds write in DO-While loop Signed-off-by: Noah Metzger --- ccutil/unicharset.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccutil/unicharset.cpp b/ccutil/unicharset.cpp index 4a62973dca..a068062266 100644 --- a/ccutil/unicharset.cpp +++ b/ccutil/unicharset.cpp @@ -639,7 +639,7 @@ void UNICHARSET::unichar_insert(const char* const unichar_repr, } int index = 0; do { - if (index > UNICHAR_LEN) { + if (index >= UNICHAR_LEN) { fprintf(stderr, "Utf8 buffer too big, size>%d for %s\n", UNICHAR_LEN, unichar_repr); return;