diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2024-05-17 18:11:59 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2024-05-17 18:11:59 +0000 |
commit | 58ab40bab178c74ea136ae435c10c7d3a364129e (patch) | |
tree | 25e31f632d7f15ea6305b1b7eec770760be6ffc2 /gnu | |
parent | 81c4dea22eaabf4efe207b7aceb96556ded8db09 (diff) |
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@
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/perl/locale.c | 2 |
1 files changed, 1 insertions, 1 deletions
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 |