aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortony <tsyrogit@users.noreply.github.com>2019-09-29 21:56:15 +0100
committertony <tsyrogit@users.noreply.github.com>2019-09-29 21:58:49 +0100
commitdb2da84a8617f590e7b8dc86aaeb69b5e3c67be1 (patch)
tree9718df6aed147885ebd6d4341b343e2b4ee6c056
parent5d7ef7c537b0ae8bf8c8696ea4241cf29a572853 (diff)
downloadzxcvbn-c-db2da84a8617f590e7b8dc86aaeb69b5e3c67be1.tar.gz
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.
-rw-r--r--.gitignore1
-rw-r--r--dict-generate.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 2a522d5..eabe448 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,5 +24,6 @@ zxcvbn.dict
test-*file
test-*line
test-*lib
+test-internals
dictgen
dict-*.h
diff --git a/dict-generate.cpp b/dict-generate.cpp
index 711124d..9fcc95d 100644
--- a/dict-generate.cpp
+++ b/dict-generate.cpp
@@ -889,7 +889,7 @@ void CreateArrays(NodeSPtr Root, StringIntSet_t & StrSet, StringOfInts & ChildAd
}
if (x >= (1 << BITS_CHILD_MAP_INDEX))
{
- char Tmp[20];
+ char Tmp[24];
snprintf(Tmp, sizeof Tmp, "%lu", x);
throw string("Not enough bits for child map index value of ") + Tmp + " for " +
Its->s + " (BITS_CHILD_MAP_INDEX too small)";