summaryrefslogtreecommitdiff
path: root/regen
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-03-12 12:48:47 -0600
committerKarl Williamson <khw@cpan.org>2020-07-30 16:50:12 -0600
commit981fbfc16220a15e72457d8ece4e014988746946 (patch)
tree800c2a97e4a62262314049641c6b50f5330dbebd /regen
parent3c53c6179afbdbef748c110abdb849cb463c2727 (diff)
downloadperl-981fbfc16220a15e72457d8ece4e014988746946.tar.gz
reentr.c: Prevent infinite looping
This is an easy, though paranoid hedge to prevent something that should never happen from causing an infinite loop if it were to happen.
Diffstat (limited to 'regen')
-rw-r--r--regen/reentr.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/regen/reentr.pl b/regen/reentr.pl
index 94721e9dec..ba2e1c8fa6 100644
--- a/regen/reentr.pl
+++ b/regen/reentr.pl
@@ -818,7 +818,7 @@ print $c <<"EOF";
#define RenewDouble(data_pointer, size_pointer, type) \\
STMT_START { \\
- const size_t size = *(size_pointer) * 2; \\
+ const size_t size = MAX(*(size_pointer), 1) * 2; \\
Renew((data_pointer), (size), type); \\
*(size_pointer) = size; \\
} STMT_END