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 authored and khwilliamson committed May 31, 2021
1 parent fef07e7 commit 8a2e41f
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 8a2e41f

Please sign in to comment.