Skip to content

Commit 21e25d1

Browse files
committed
Fixed a memory corruption, detected by Coverity
CID 1385632 Out-of-bounds write in DO-While loop Signed-off-by: Noah Metzger <noah.metzger@bib.uni-mannheim.de>
1 parent 36d6cb3 commit 21e25d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ccutil/unicharset.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ void UNICHARSET::unichar_insert(const char* const unichar_repr,
639639
}
640640
int index = 0;
641641
do {
642-
if (index > UNICHAR_LEN) {
642+
if (index >= UNICHAR_LEN) {
643643
fprintf(stderr, "Utf8 buffer too big, size>%d for %s\n", UNICHAR_LEN,
644644
unichar_repr);
645645
return;

0 commit comments

Comments
 (0)