summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
authorHugo van der Sanden <hv@crypt.org>2021-05-22 19:39:11 +0100
committerKarl Williamson <khw@cpan.org>2021-05-31 07:00:12 -0600
commit8a2e41ffbc376a86586e2b42daa43293299622c5 (patch)
tree77cd7b5636c434fcbf15c6b291a9bedbf6014c76 /locale.c
parentfef07e7ee7d3a793984bce01ede271a218c02cb6 (diff)
downloadperl-8a2e41ffbc376a86586e2b42daa43293299622c5.tar.gz
gh17824: zero curlocales[]
Static analysis tools such as Coverity and clang report that we can otherwise end up reading uninitialized data, and inspection agrees.
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/locale.c b/locale.c
index eb6590f598..102fd970a0 100644
--- a/locale.c
+++ b/locale.c
@@ -3388,6 +3388,9 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
my_strlcpy(PL_locale_utf8ness, C_and_POSIX_utf8ness,
sizeof(PL_locale_utf8ness));
+ /* See https://github.com/Perl/perl5/issues/17824 */
+ Zero(curlocales, NOMINAL_LC_ALL_INDEX, char *);
+
# ifdef USE_THREAD_SAFE_LOCALE
# ifdef WIN32