diff options
author | Salvador Ortiz Garcia <sog@msg.com.mx> | 2009-09-06 23:41:57 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-09-06 23:41:57 +0200 |
commit | d8723a6a74b2c12e9d732728dbe717672ab893f2 (patch) | |
tree | 24f0470722ebc791b8faebc46444e8c649c2894b | |
parent | acb65a20b3f3b0f0cee262142e279624eaae58bb (diff) | |
download | perl-d8723a6a74b2c12e9d732728dbe717672ab893f2.tar.gz |
Corrupt filename when setting %INC entry in a @INC hook
The code in pp_ctl.c after calling an @INC hook blindly assumes that the
SV setted by the user in %INC is an SVPV (SvPOK true) for setting the
filename. So when the user uses other scalar types, the output of
__FILE__, warn, die, caller, etc. shows random garbage.
-rw-r--r-- | pp_ctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -3354,7 +3354,7 @@ PP(pp_require) /* Adjust file name if the hook has set an %INC entry */ svp = hv_fetch(GvHVn(PL_incgv), name, len, 0); if (svp) - tryname = SvPVX_const(*svp); + tryname = SvPV_nolen_const(*svp); if (count > 0) { int i = 0; |