Skip to content

Commit db2da84

Browse files
committed
Stop GCC 8.3 warning about possible buffer overrun when generating a dictionary.
In practice this would never occur as it requires making a Peta-byte sized string to trigger the error.
1 parent 5d7ef7c commit db2da84

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ zxcvbn.dict
2424
test-*file
2525
test-*line
2626
test-*lib
27+
test-internals
2728
dictgen
2829
dict-*.h

dict-generate.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ void CreateArrays(NodeSPtr Root, StringIntSet_t & StrSet, StringOfInts & ChildAd
889889
}
890890
if (x >= (1 << BITS_CHILD_MAP_INDEX))
891891
{
892-
char Tmp[20];
892+
char Tmp[24];
893893
snprintf(Tmp, sizeof Tmp, "%lu", x);
894894
throw string("Not enough bits for child map index value of ") + Tmp + " for " +
895895
Its->s + " (BITS_CHILD_MAP_INDEX too small)";

0 commit comments

Comments
 (0)