This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In pp_eof, ensure stack space for the second argument to the tied EOF method.
authorNicholas Clark <nick@ccl4.org>
Sun, 13 Jun 2010 07:50:00 +0000 (08:50 +0100)
committerNicholas Clark <nick@ccl4.org>
Sun, 13 Jun 2010 07:50:00 +0000 (08:50 +0100)
Commit 32e653230c7ccc7f added this second argument, but didn't verify that the
stack always had sufficient space for it.

pp_sys.c

index 3525bfe..44b8cf4 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2031,6 +2031,7 @@ PP(pp_eof)
         * 1 = eof(FH)
         * 2 = eof()  <- ARGV magic
         */
+       EXTEND(SP, 1);
        if (MAXARG)
            mPUSHi(1);          /* 1 = eof(FH) - simple, explicit FH */
        else if (PL_op->op_flags & OPf_SPECIAL)