This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Avoid reading before the buffer start when generating errors from require.
authorNicholas Clark <nick@ccl4.org>
Wed, 27 Jun 2012 16:25:50 +0000 (18:25 +0200)
committerNicholas Clark <nick@ccl4.org>
Wed, 1 Aug 2012 20:34:40 +0000 (22:34 +0200)
commit2fc7dfcbbf2c319e5b0c6f61e4925c97d972274d
treeecd8254c95bba2566317d92d37d567a859bcb62e
parent1f64ae15647e757e817c923b2a9fcbc528c5f610
Avoid reading before the buffer start when generating errors from require.

In pp_require, the error reporting code treats file names ending /\.p?h\z/
specially. The detection code for this, as refactored in 2010 by commit
686c4ca09cf9d6ae, could read one or two bytes before the start of the
filename for filenames less than 3 bytes long. (Note this cannot happen with
module names given to use or require, as appending ".pm" will always make the
filename at least 3 bytes long.)
pp_ctl.c
t/op/require_errors.t