From db2da84a8617f590e7b8dc86aaeb69b5e3c67be1 Mon Sep 17 00:00:00 2001 From: tony Date: Sun, 29 Sep 2019 21:56:15 +0100 Subject: 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. --- .gitignore | 1 + dict-generate.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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)"; -- cgit v1.2.3