Change 14405 by jhi@alpha on 2002/01/24 15:44:31
The
Subject: Very old debugger UTF-8 bug
From: [EMAIL PROTECTED] (Andreas J. Koenig)
Date: 24 Jan 2002 12:45:44 +0100
Message-ID: <[EMAIL PROTECTED]>
still broken, but this should work as a stopgap
measure to stop pp_match accessing naughty data.
Affected files ...
.... //depot/perl/pod/perldiag.pod#266 edit
.... //depot/perl/pp_hot.c#269 edit
Differences ...
==== //depot/perl/pod/perldiag.pod#266 (text) ====
Index: perl/pod/perldiag.pod
--- perl/pod/perldiag.pod.~1~ Thu Jan 24 09:00:05 2002
+++ perl/pod/perldiag.pod Thu Jan 24 09:00:05 2002
@@ -2515,7 +2515,7 @@
(P) We popped the context stack to an eval context, and then discovered
it wasn't an eval context.
-=item panic: pp_match
+=item panic: pp_match%s
(P) The internal pp_match() routine was called with invalid operational
data.
==== //depot/perl/pp_hot.c#269 (text) ====
Index: perl/pp_hot.c
--- perl/pp_hot.c.~1~ Thu Jan 24 09:00:05 2002
+++ perl/pp_hot.c Thu Jan 24 09:00:05 2002
@@ -1322,6 +1322,9 @@
/*SUPPRESS 560*/
if ((rx->startp[i] != -1) && rx->endp[i] != -1 ) {
len = rx->endp[i] - rx->startp[i];
+ if (rx->endp[i] < 0 || rx->startp[i] < 0 ||
+ len < 0 || len > strend - s)
+ DIE(aTHX_ "panic: pp_match start/end pointers");
s = rx->startp[i] + truebase;
sv_setpvn(*SP, s, len);
if (DO_UTF8(TARG) && is_utf8_string((U8*)s, len))
End of Patch.