diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2008-07-15 08:59:13 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2008-07-15 08:59:13 +0000 |
commit | 219bf41872a28e4a469d4274a14dca87429a5a5e (patch) | |
tree | 240666aa427d8bd88a5cdebf7e48798d6ca31b3c /util.c | |
parent | a469502ffde47af0b05b575bdfc51039218392df (diff) | |
download | perl-219bf41872a28e4a469d4274a14dca87429a5a5e.tar.gz |
Upgrade to version 0.76 by John Peacock
Fix segfault in serialized version objects
(bug #56606)
p4raw-id: //depot/perl@34142
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 23 |
1 files changed, 15 insertions, 8 deletions
@@ -4814,21 +4814,28 @@ the original version contained 1 or more dots, respectively SV * Perl_vstringify(pTHX_ SV *vs) { - SV *pv; - PERL_ARGS_ASSERT_VSTRINGIFY; if ( SvROK(vs) ) vs = SvRV(vs); - + if ( !vverify(vs) ) Perl_croak(aTHX_ "Invalid version object"); - pv = *hv_fetchs((HV*)vs, "original", FALSE); - if ( SvPOK(pv) ) - return newSVsv(pv); - else - return &PL_sv_undef; + if (hv_exists((HV*)vs, "original", sizeof("original") - 1)) { + SV *pv; + pv = *hv_fetchs((HV*)vs, "original", FALSE); + if ( SvPOK(pv) ) + return newSVsv(pv); + else + return &PL_sv_undef; + } + else { + if ( hv_exists((HV *)vs, "qv", 2) ) + return vnormal(vs); + else + return vnumify(vs); + } } /* |