From: Gurusamy Sarathy Date: Fri, 11 Feb 2000 16:36:14 +0000 (+0000) Subject: fix uninitialized memory reads found by purify X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8ecf71871febb31312d723e89648aadebf858ae1;p=p5sagit%2Fp5-mst-13.2.git fix uninitialized memory reads found by purify p4raw-id: //depot/perl@5063 --- diff --git a/ext/Devel/Peek/Peek.xs b/ext/Devel/Peek/Peek.xs index 8af8847..e7f5746 100644 --- a/ext/Devel/Peek/Peek.xs +++ b/ext/Devel/Peek/Peek.xs @@ -3,12 +3,12 @@ #include "perl.h" #include "XSUB.h" -#ifdef PURIFY -#define DeadCode() NULL -#else SV * DeadCode(pTHX) { +#ifdef PURIFY + return Nullsv; +#else SV* sva; SV* sv, *dbg; SV* ret = newRV_noinc((SV*)newAV()); @@ -114,8 +114,8 @@ DeadCode(pTHX) PerlIO_printf(Perl_debug_log, "total: refs: %i, strings: %i in %i\targsarray: %i, argsstrings: %i\n", tref, tm, ts, ta, tas); return ret; -} #endif /* !PURIFY */ +} #if defined(PERL_DEBUGGING_MSTATS) || defined(DEBUGGING_MSTATS) \ || (defined(MYMALLOC) && !defined(PLAIN_MALLOC)) diff --git a/regcomp.c b/regcomp.c index 5df82c0..57a3bad 100644 --- a/regcomp.c +++ b/regcomp.c @@ -277,6 +277,7 @@ S_cl_is_anything(pTHX_ struct regnode_charclass_class *cl) STATIC void S_cl_init(pTHX_ struct regnode_charclass_class *cl) { + Zero(cl, 1, struct regnode_charclass_class); cl->type = ANYOF; cl_anything(cl); } @@ -284,10 +285,9 @@ S_cl_init(pTHX_ struct regnode_charclass_class *cl) STATIC void S_cl_init_zero(pTHX_ struct regnode_charclass_class *cl) { + Zero(cl, 1, struct regnode_charclass_class); cl->type = ANYOF; cl_anything(cl); - ANYOF_CLASS_ZERO(cl); - ANYOF_BITMAP_ZERO(cl); if (LOC) cl->flags |= ANYOF_LOCALE; }