1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-03 06:45:37 -08:00

Fix possible segmentation fault in Perl 5.38.2.

When calling POSIX::setlocale() with unknown locale category, Perl
could crash due to NULL dereference.

found by sthen@ in smokeping build; OK afresh1@
This commit is contained in:
bluhm 2024-05-17 18:11:58 +00:00
parent 68e76eaff5
commit d635388b71

View File

@ -2858,7 +2858,7 @@ Perl_setlocale(const int category, const char * locale)
/* If the new locale is the same as the current one, nothing is actually
* being changed, so do nothing. */
if ( strEQ(retval, locale)
if ( retval != NULL && strEQ(retval, locale)
&& ( ! affects_LC_NUMERIC(category)
# ifdef USE_LOCALE_NUMERIC