diff options
author | Hugo van der Sanden <hv@crypt.org> | 2015-03-24 07:29:55 +0000 |
---|---|---|
committer | Hugo van der Sanden <hv@crypt.org> | 2015-03-25 01:01:23 +0000 |
commit | ff36bb50a704e1926451063369ace915b3074f06 (patch) | |
tree | 17cbe8c6e13cca6ca9e7185eb3e2fc0870ad67b3 /pp.h | |
parent | 2fcbb74a67c62e89b625fc824fcddb7de6519a28 (diff) | |
download | perl-ff36bb50a704e1926451063369ace915b3074f06.tar.gz |
fix signed/unsigned mismatch in (M)EXTEND
A large enough allocation request could wrap, causing MEXTEND to decide
the stack was already big enough.
Diffstat (limited to 'pp.h')
-rw-r--r-- | pp.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -278,21 +278,21 @@ Does not use C<TARG>. See also C<XPUSHu>, C<mPUSHu> and C<PUSHu>. } STMT_END /* Same thing, but update mark register too. */ # define MEXTEND(p,n) STMT_START { \ - const int markoff = mark - PL_stack_base; \ + const SSize_t markoff = mark - PL_stack_base; \ sp = stack_grow(sp,p,(SSize_t) (n)); \ mark = PL_stack_base + markoff; \ PERL_UNUSED_VAR(sp); \ } STMT_END #else # define EXTEND(p,n) STMT_START { \ - if (UNLIKELY(PL_stack_max - p < (int)(n))) { \ + if (UNLIKELY(PL_stack_max - p < (SSize_t)(n))) { \ sp = stack_grow(sp,p,(SSize_t) (n)); \ PERL_UNUSED_VAR(sp); \ } } STMT_END /* Same thing, but update mark register too. */ # define MEXTEND(p,n) STMT_START { \ - if (UNLIKELY(PL_stack_max - p < (int)(n))) { \ - const int markoff = mark - PL_stack_base; \ + if (UNLIKELY(PL_stack_max - p < (SSize_t)(n))) { \ + const SSize_t markoff = mark - PL_stack_base; \ sp = stack_grow(sp,p,(SSize_t) (n)); \ mark = PL_stack_base + markoff; \ PERL_UNUSED_VAR(sp); \ |