Skip to content

Commit

Permalink
Fixed a memory corruption, detected by Coverity
Browse files Browse the repository at this point in the history
CID 1385632 Out-of-bounds write in DO-While loop

Signed-off-by: Noah Metzger <[email protected]>
  • Loading branch information
noahmetzger committed Apr 18, 2018
1 parent 36d6cb3 commit 21e25d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ccutil/unicharset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 21e25d1

Please sign in to comment.