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