diff options
author | Karl Williamson <khw@cpan.org> | 2020-03-12 12:48:47 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-07-30 16:50:12 -0600 |
commit | 981fbfc16220a15e72457d8ece4e014988746946 (patch) | |
tree | 800c2a97e4a62262314049641c6b50f5330dbebd /regen | |
parent | 3c53c6179afbdbef748c110abdb849cb463c2727 (diff) | |
download | perl-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.pl | 2 |
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 |