Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37706814
en ru br
Репозитории ALT
S:5.34.1-alt1
5.1: 5.8.9-alt3
4.1: 5.8.8-alt19.M41.1
4.0: 5.8.8-alt14
+updates:5.8.8-alt14
3.0: 5.8.7-alt2
www.altlinux.org/Changes

Группа :: Разработка/Perl
Пакет: perl

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: perl-5.33.0-reentr.c-Buffer-sizes-for-asctime_r-ctime_r-are-smal.patch
Скачать


From 81169c06a76f62ff987ed990ac910c2ae08b3f91 Mon Sep 17 00:00:00 2001
From: Karl Williamson <khw@cpan.org>
Date: Tue, 10 Mar 2020 15:19:57 -0600
Subject: [PATCH] reentr.c: Buffer sizes for asctime_r,ctime_r are small
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The needed sizes of these are stated in the man pages, and are much
smaller than were being allocated.
Signed-off-by: Petr Pц╜saе≥ <ppisar@redhat.com>
---
 reentr.c        | 4 ++--
 regen/reentr.pl | 5 ++++-
 2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/reentr.c b/reentr.c
index 8ddda7bfc0..8438c8f90f 100644
--- a/reentr.c
+++ b/reentr.c
@@ -52,14 +52,14 @@ Perl_reentrant_size(pTHX) {
 #  define REENTRANTUSUALSIZE	4096	/* Make something up. */
 
 #  ifdef HAS_ASCTIME_R
-	PL_reentrant_buffer->_asctime_size = REENTRANTSMALLSIZE;
+	PL_reentrant_buffer->_asctime_size = 26;
 #  endif /* HAS_ASCTIME_R */
 
 #  ifdef HAS_CRYPT_R
 #  endif /* HAS_CRYPT_R */
 
 #  ifdef HAS_CTIME_R
-	PL_reentrant_buffer->_ctime_size = REENTRANTSMALLSIZE;
+	PL_reentrant_buffer->_ctime_size = 26;
 #  endif /* HAS_CTIME_R */
 
 #  ifdef HAS_GETGRNAM_R
diff --git a/regen/reentr.pl b/regen/reentr.pl
index f5788c7ad9..94721e9dec 100644
--- a/regen/reentr.pl
+++ b/regen/reentr.pl
@@ -495,8 +495,11 @@ for my $func (@seenf) {
 	char*	_${func}_buffer;
 	size_t	_${func}_size;
 EOF
+            my $size = ($func =~ /^(asctime|ctime)$/)
+                       ? 26
+                       : "REENTRANTSMALLSIZE";
 	    push @size, <<EOF;
-	PL_reentrant_buffer->_${func}_size = REENTRANTSMALLSIZE;
+	PL_reentrant_buffer->_${func}_size = $size;
 EOF
 	    pushinitfree $func;
 	    pushssif $endif;
-- 
2.25.4
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin