diff options
author | tony <tsyrogit@users.noreply.github.com> | 2019-09-29 21:56:15 +0100 |
---|---|---|
committer | tony <tsyrogit@users.noreply.github.com> | 2019-09-29 21:58:49 +0100 |
commit | db2da84a8617f590e7b8dc86aaeb69b5e3c67be1 (patch) | |
tree | 9718df6aed147885ebd6d4341b343e2b4ee6c056 | |
parent | 5d7ef7c537b0ae8bf8c8696ea4241cf29a572853 (diff) | |
download | zxcvbn-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-- | .gitignore | 1 | ||||
-rw-r--r-- | dict-generate.cpp | 2 |
2 files changed, 2 insertions, 1 deletions
@@ -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)"; |