In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/ecf0432f1e8289d3b387151b8bf1968133dda7f2?hp=bec4f4b4610b628e92890392df1dcddac6e7b7e8>
- Log ----------------------------------------------------------------- commit ecf0432f1e8289d3b387151b8bf1968133dda7f2 Author: Father Chrysostomos <spr...@cpan.org> Date: Sun Sep 26 14:28:31 2010 -0700 $ perl5.6.2 -MData::Dumper -le' Data::Dumper->Dumpxs([*{*STDERR{IO}}])' Bus error Same in 5.11.4. This is related to bug 71254. It turns out that globs *can* stringify emptily (see bug 65582). This patch makes DD more resilient. ----------------------------------------------------------------------- Summary of changes: dist/Data-Dumper/Dumper.xs | 2 +- dist/Data-Dumper/t/bugs.t | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dist/Data-Dumper/Dumper.xs b/dist/Data-Dumper/Dumper.xs index 52a57f8..7845962 100644 --- a/dist/Data-Dumper/Dumper.xs +++ b/dist/Data-Dumper/Dumper.xs @@ -909,7 +909,7 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv, } else if (realtype == SVt_PVGV) {/* GLOBs can end up with scribbly names */ c = SvPV(val, i); - ++c; --i; /* just get the name */ + if(i) ++c, --i; /* just get the name */ if (i >= 6 && strncmp(c, "main::", 6) == 0) { c += 4; i -= 4; diff --git a/dist/Data-Dumper/t/bugs.t b/dist/Data-Dumper/t/bugs.t index cf2803f..3c5d141 100644 --- a/dist/Data-Dumper/t/bugs.t +++ b/dist/Data-Dumper/t/bugs.t @@ -12,7 +12,7 @@ BEGIN { } use strict; -use Test::More tests => 5; +use Test::More tests => 6; use Data::Dumper; { @@ -80,4 +80,9 @@ sub doh doh('fixed'); ok(1, "[perl #56766]"); # Still no core dump? We are fine. +# [perl #72332] Segfault on empty-string glob +Data::Dumper->Dump([*{*STDERR{IO}}]); +ok("ok", #ok + "empty-string glob [perl #72332]"); + # EOF -- Perl5 Master Repository