external/zxcvbn-c/0001-use-const-for-these-arrays.patch.1 | 42 ++++++++++++++ external/zxcvbn-c/UnpackedTarball_zxcvbn-c.mk | 3 + 2 files changed, 45 insertions(+)
New commits: commit 8f7055adc0036df47891243d8b8c7548f03e56fd Author: Caolán McNamara <[email protected]> AuthorDate: Sat Jul 12 21:26:59 2025 +0100 Commit: Mike Kaganski <[email protected]> CommitDate: Thu Jul 24 12:33:47 2025 +0200 const up zxcvbn-c Change-Id: Idbcff3cba17233a9d9746650cdda5129c0f4790b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187788 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins (cherry picked from commit 645ede66b260bb5a95e229d3a7f4f24c6b9f18d7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188073 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Mike Kaganski <[email protected]> diff --git a/external/zxcvbn-c/0001-use-const-for-these-arrays.patch.1 b/external/zxcvbn-c/0001-use-const-for-these-arrays.patch.1 new file mode 100644 index 000000000000..77cd9876921d --- /dev/null +++ b/external/zxcvbn-c/0001-use-const-for-these-arrays.patch.1 @@ -0,0 +1,42 @@ +From fb847af696b873750adf2e61410d897d128f3dee Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <[email protected]> +Date: Sat, 12 Jul 2025 21:21:48 +0100 +Subject: [PATCH] use const for these arrays + +so they don't appear in the .data section. With const WordEndBits +ends up in the .rodata section and Formats in the .data.rel.ro +section. +--- + dict-generate.cpp | 2 +- + zxcvbn.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dict-generate.cpp b/dict-generate.cpp +index 878b4aa..7041be7 100644 +--- a/dict-generate.cpp ++++ b/dict-generate.cpp +@@ -1246,7 +1246,7 @@ int OutputCode(ostream *Out, bool Cmnts, const string & CharSet, StringIntSet_t + unsigned int Len = ((NodeData.size() + 7) / 8); + OutputSize += Len; + x = 999; +- *Out << "static unsigned char WordEndBits[" << Len << "] = {"; ++ *Out << "static const unsigned char WordEndBits[" << Len << "] = {"; + Index = 0; + unsigned int v = 0; + unsigned int y = 0; +diff --git a/zxcvbn.c b/zxcvbn.c +index 95aa88f..f6d843b 100644 +--- a/zxcvbn.c ++++ b/zxcvbn.c +@@ -1228,7 +1228,7 @@ static void SpatialMatch(ZxcMatch_t **Result, const uint8_t *Passwd, int Start, + + /* The possible date formats ordered by length (d for day, m for month, */ + /* y for year, ? for separator) */ +-static const char *Formats[] = ++static const char * const Formats[] = + { + "yyyy", + "d?m?yy", +-- +2.49.0 + diff --git a/external/zxcvbn-c/UnpackedTarball_zxcvbn-c.mk b/external/zxcvbn-c/UnpackedTarball_zxcvbn-c.mk index b3b76aa3ef1c..a1167ae708e0 100644 --- a/external/zxcvbn-c/UnpackedTarball_zxcvbn-c.mk +++ b/external/zxcvbn-c/UnpackedTarball_zxcvbn-c.mk @@ -13,9 +13,12 @@ $(eval $(call gb_UnpackedTarball_set_tarball,zxcvbn-c,$(ZXCVBN_C_TARBALL))) # * external/zxcvbn-c/0001-There-is-no-std-basic_string-int.patch.1 sent upstream as # <https://github.com/tsyrogit/zxcvbn-c/pull/31> "There is no std::basic_string<int>": +# * external/zxcvbn-c/0001-use-const-for-these-arrays.patch.1 sent upstream as +# <https://github.com/tsyrogit/zxcvbn-c/pull/37> "use const for these arrays": $(eval $(call gb_UnpackedTarball_add_patches,zxcvbn-c,\ external/zxcvbn-c/zxcvbn-c-2.5-do-not-use-stdafx.patch \ external/zxcvbn-c/0001-There-is-no-std-basic_string-int.patch.1 \ + external/zxcvbn-c/0001-use-const-for-these-arrays.patch.1 \ )) # vim: set noet sw=4 ts=4:
