From: Larry Wall Date: Wed, 11 Jan 1995 22:06:42 +0000 (-0800) Subject: [fix crash in regexec.c] X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=420218e7eb4fa5ceefe298e6d9121548b8d806d6;p=p5sagit%2Fp5-mst-13.2.git [fix crash in regexec.c] In article <3ekgoo@giga.bga.com> jamshid@ses.com (Jamshid Afshar) writes: : I'm getting some unexpected behavior for a small perl script on SunOS : 4.1.3 perl 4.0p36. The same script crashes under perl 5.0 on HP-UX. : That script is at the end of this article -- it's as small as I could : make it and still reproduce the crash. Here's an unofficial patch for the problem in Perl 5. Larry --- diff --git a/regexec.c b/regexec.c index 1267065..3992aaf 100644 --- a/regexec.c +++ b/regexec.c @@ -471,10 +471,10 @@ I32 safebase; /* no need to remember string in subbase */ goto phooey; got_it: + strend += dontbother; /* uncheat */ prog->subbeg = strbeg; prog->subend = strend; if ((!safebase && (prog->nparens || sawampersand)) || prog->do_folding) { - strend += dontbother; /* uncheat */ i = strend - startpos + (stringarg - strbeg); if (safebase) { /* no need for $digit later */ s = strbeg;