Skip to content

Commit

Permalink
gh17824: zero curlocales[]
Browse files Browse the repository at this point in the history
Static analysis tools such as Coverity and clang report that we can
otherwise end up reading uninitialized data, and inspection agrees.

(cherry picked from commit 8a2e41f)
  • Loading branch information
hvds authored and steve-m-hay committed Feb 26, 2022
1 parent 63f36a9 commit 932f6a0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions locale.c
Expand Up @@ -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

Expand Down

0 comments on commit 932f6a0

Please sign in to comment.