From 543a843b5a5feefefae2cae19d5432101b05d235 Mon Sep 17 00:00:00 2001 From: Hugo van der Sanden Date: Sat, 22 May 2021 19:39:11 +0100 Subject: [PATCH] gh17824: zero curlocales[] Static analysis tools such as Coverity and clang report that we can otherwise end up reading uninitialized data, and inspection agrees. --- locale.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/locale.c b/locale.c index eb6590f598fb..102fd970a006 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