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>
This commit is contained in:
Noah Metzger 2018-04-17 16:30:03 +02:00
parent 36d6cb3a46
commit 21e25d1829

View File

@ -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;