Skip Menu |

This queue is for tickets about the version CPAN distribution.

Report information
The Basics
Id: 18490
Status: resolved
Priority: 0/
Queue: version

People
Owner: Nobody in particular
Requestors: audreyt [...] audreyt.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: [PATCH] vxs segfaults on Jifty's Makefile.PL
Date: Sat, 01 Apr 2006 12:33:01 +0800
To: bug-version [...] rt.cpan.org, jpeacock [...] rowman.com
From: Audrey Tang <audreyt [...] audreyt.org>
Download signature.asc
application/pgp-signature 187b

Message body not shown because it is not plain text.

This patch fixes a segfault occurred on my freebsd laptop with Jifty's Makefile.PL that checks for version.pm. I don't really know what's happening here, but testing for a null pointer before SvOK()'ing it seems to be an acceptable practice anyway. Thanks! Audrey
--- vxs.xs.orig Sat Apr 1 13:28:57 2006 +++ vxs.xs Sat Apr 1 13:29:11 2006 @@ -201,7 +201,7 @@ gvp = pkg ? (GV**)hv_fetch(pkg,"VERSION",7,FALSE) : Null(GV**); - if (gvp && isGV(gv = *gvp) && SvOK(sv = GvSV(gv))) { + if (gvp && isGV(gv = *gvp) && (sv = GvSV(gv)) && SvOK(sv)) { SV *nsv = sv_newmortal(); sv_setsv(nsv, sv); sv = nsv;
I've applied the change to the repository. What is odd is that code exactly like this was in the Perl core from 1999 until I fixed it July of last year (clearly it is a hard bug to exercise). I don't know why I didn't also add that to the version.pm copy, too. Thanks John