summaryrefslogtreecommitdiff
path: root/op.c
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 /op.c
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
Diffstat (limited to 'op.c')
-rw-r--r--op.c3
1 files changed, 3 insertions, 0 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 */