This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Use SSize_t when extending the stack
authorFather Chrysostomos <sprout@cpan.org>
Sun, 25 Aug 2013 02:09:59 +0000 (19:09 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 25 Aug 2013 13:39:28 +0000 (06:39 -0700)
commitfc16c3924bd6aa054f21ad5445fecf9b7f39dc36
treea0ac4568d977ef5c9e125c7bae9e6de466d48146
parente8eb279cb8d8b30256eb8b1957e1dabed28fc4eb
Use SSize_t when extending the stack

(I am referring to what is usually known simply as The Stack.)

This partially fixes #119161.

By casting the argument to int, we can end up truncating/wrapping
it on 64-bit systems, so EXTEND(SP, 2147483648) translates into
EXTEND(SP, -1), which does not extend the stack at all.  Then writing
to the stack in code like ()=1..1000000000000 goes past the end of
allocated memory and crashes.

I can’t really write a test for this, since instead of crashing it
will use more memory than I have available (and then I’ll start for-
getting things).
av.c
embed.fnc
pp.h
proto.h
scope.c