From: Rafael Garcia-Suarez Date: Mon, 23 Apr 2007 13:10:56 +0000 (+0000) Subject: A safer version of CopFILE, by Jarkko X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=be46dfad8454bd0b9f81c4669d39e0b12a423541;p=p5sagit%2Fp5-mst-13.2.git A safer version of CopFILE, by Jarkko p4raw-id: //depot/perl@31032 --- diff --git a/cop.h b/cop.h index c59a7d6..72cf84c 100644 --- a/cop.h +++ b/cop.h @@ -213,7 +213,8 @@ struct cop { # else # define CopFILEAVx(c) (GvAV(CopFILEGV(c))) # endif -# define CopFILE(c) (CopFILESV(c) ? SvPVX(CopFILESV(c)) : NULL) +# define CopFILE(c) (CopFILEGV(c) && GvSV(CopFILEGV(c)) \ + ? SvPVX(GvSV(CopFILEGV(c))) : NULL) # define CopSTASH(c) ((c)->cop_stash) # define CopLABEL(c) ((c)->cop_label) # define CopSTASH_set(c,hv) ((c)->cop_stash = (hv))