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.
  • Loading branch information
hvds committed May 22, 2021
1 parent 36f923e commit 543a843
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 543a843

Please sign in to comment.