Change 34467 by [EMAIL PROTECTED] on 2008/10/06 16:31:35
Subject: [PATCH] Invalid read in regdupe in maint-5.8
From: Vincent Pit <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
Date: Thu, 25 Sep 2008 17:53:14 +0200
which is the logical equivalent to:
Integrate:
[ 34465]
Integrate:
[ 34464]
Avoid allocating 1 extra regnode when duplicating a regexp.
See
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-09/msg00590.html
and
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-10/msg00163.html
Affected files ...
... //depot/maint-5.8/perl/regcomp.c#120 integrate
Differences ...
==== //depot/maint-5.8/perl/regcomp.c#120 (text) ====
Index: perl/regcomp.c
--- perl/regcomp.c#119~33932~ 2008-05-25 16:00:21.000000000 -0700
+++ perl/regcomp.c 2008-10-06 09:31:35.000000000 -0700
@@ -4840,7 +4840,7 @@
len = r->offsets[0];
npar = r->nparens+1;
- size = sizeof(regexp) + (len+1)*sizeof(regnode);
+ size = sizeof(regexp) + len*sizeof(regnode);
Newxc(ret, size, char, regexp);
Copy(r, ret, size, char);
End of Patch.