summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-02-13 19:02:07 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-02-13 19:02:07 +0000
commit0f79a09d62eb410185d697430134f937ab4e917d (patch)
tree79a361d65e09a6a28c1ab478935463a3d36adb2e /regcomp.c
parent8ecf71871febb31312d723e89648aadebf858ae1 (diff)
downloadperl-0f79a09d62eb410185d697430134f937ab4e917d.tar.gz
more purification (pp_require() could access free memory; vdie()
could think message was random length when passed a null argument; utilize() didn't set up the hash for the method name leading to pp_method_named() accessing random state; PL_curpm wasn't zeroed properly) p4raw-id: //depot/perl@5072
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/regcomp.c b/regcomp.c
index 57a3bad9b8..ca0b1d10d3 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -1388,6 +1388,10 @@ Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm)
char, regexp);
if (r == NULL)
FAIL("regexp out of space");
+#ifdef DEBUGGING
+ /* avoid reading uninitialized memory in DEBUGGING code in study_chunk() */
+ Zero(r, sizeof(regexp) + (unsigned)PL_regsize * sizeof(regnode), char);
+#endif
r->refcnt = 1;
r->prelen = xend - exp;
r->precomp = PL_regprecomp;