summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo van der Sanden <hv@crypt.org>2002-08-23 12:23:31 +0000
committerhv <hv@crypt.org>2002-08-23 12:23:31 +0000
commit1ecdd9a87cdfac3d4938733086a89d685b66dfb5 (patch)
treea33dee174f434858c6f553ca7eaa3ccc83e71cfa
parentba329e04450c9e718e3584348f2d0f15c4762fb6 (diff)
downloadperl-1ecdd9a87cdfac3d4938733086a89d685b66dfb5.tar.gz
#17747 caused bad free()s with PERL_DESTRUCT by calling newXS()
with a NULL subaddr. Fix that, and stop it happening again. p4raw-id: //depot/perl@17763
-rw-r--r--op.c3
-rw-r--r--universal.c1
2 files changed, 3 insertions, 1 deletions
diff --git a/op.c b/op.c
index 043f0be6c0..5c55f0d5f9 100644
--- a/op.c
+++ b/op.c
@@ -5217,6 +5217,9 @@ Perl_newXS(pTHX_ char *name, XSUBADDR_t subaddr, char *filename)
GV_ADDMULTI, SVt_PVCV);
register CV *cv;
+ if (!subaddr)
+ Perl_croak(aTHX_ "panic: no address for '%s' in '%s'", name, filename);
+
if ((cv = (name ? GvCV(gv) : Nullcv))) {
if (GvCVGEN(gv)) {
/* just a cached method */
diff --git a/universal.c b/universal.c
index 668fa3b34a..4a879e9750 100644
--- a/universal.c
+++ b/universal.c
@@ -192,7 +192,6 @@ Perl_boot_core_UNIVERSAL(pTHX)
sv_inc(sv);
SvSETMAGIC(sv);
/* Make it findable via fetchmethod */
- newXS("version::()", NULL, file);
newXS("version::new", XS_version_new, file);
newXS("version::(\"\"", XS_version_stringify, file);
newXS("version::stringify", XS_version_stringify, file);