From: bluhm Date: Fri, 17 May 2024 18:11:58 +0000 (+0000) Subject: Fix possible segmentation fault in Perl 5.38.2. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d635388b71e707340b5c73a2a98c208bc1fe72b9;p=openbsd 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@ --- diff --git a/gnu/usr.bin/perl/locale.c b/gnu/usr.bin/perl/locale.c index 92b6c1a6ec1..59c79b06c58 100644 --- a/gnu/usr.bin/perl/locale.c +++ b/gnu/usr.bin/perl/locale.c @@ -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