summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/perl/perl-5.8.8-utf-regexes.patch
diff options
context:
space:
mode:
authorJames Meyer <James.meyer@operamail.com>2008-10-02 03:19:12 (GMT)
committerJames Meyer <James.meyer@operamail.com>2008-10-02 03:19:12 (GMT)
commit0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a (patch)
treec0aa2c0b53c317be87eacfcb77b63f53f1f415e7 /abs/core-testing/perl/perl-5.8.8-utf-regexes.patch
downloadlinhes_pkgbuild-0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a.zip
linhes_pkgbuild-0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a.tar.gz
linhes_pkgbuild-0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a.tar.bz2
initial import
Diffstat (limited to 'abs/core-testing/perl/perl-5.8.8-utf-regexes.patch')
-rw-r--r--abs/core-testing/perl/perl-5.8.8-utf-regexes.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/abs/core-testing/perl/perl-5.8.8-utf-regexes.patch b/abs/core-testing/perl/perl-5.8.8-utf-regexes.patch
new file mode 100644
index 0000000..5799fff
--- /dev/null
+++ b/abs/core-testing/perl/perl-5.8.8-utf-regexes.patch
@@ -0,0 +1,59 @@
+CVE-2007-5116 perl regular expression UTF parsing errors
+https://bugzilla.redhat.com/show_bug.cgi?id=323571
+
+--- regcomp.c 2006-01-08 12:59:27.000000000 -0800
++++ regcomp.c 2007-10-05 12:07:55.000000000 -0700
+@@ -135,7 +135,8 @@
+ I32 extralen;
+ I32 seen_zerolen;
+ I32 seen_evals;
+- I32 utf8;
++ I32 utf8; /* pattern is utf8 or not */
++ I32 orig_utf8; /* pattern was originally utf8 */
+ #if ADD_TO_REGEXEC
+ char *starttry; /* -Dr: where regtry was called. */
+ #define RExC_starttry (pRExC_state->starttry)
+@@ -161,6 +162,7 @@
+ #define RExC_seen_zerolen (pRExC_state->seen_zerolen)
+ #define RExC_seen_evals (pRExC_state->seen_evals)
+ #define RExC_utf8 (pRExC_state->utf8)
++#define RExC_orig_utf8 (pRExC_state->orig_utf8)
+
+ #define ISMULT1(c) ((c) == '*' || (c) == '+' || (c) == '?')
+ #define ISMULT2(s) ((*s) == '*' || (*s) == '+' || (*s) == '?' || \
+@@ -1749,15 +1751,17 @@
+ if (exp == NULL)
+ FAIL("NULL regexp argument");
+
+- RExC_utf8 = pm->op_pmdynflags & PMdf_CMP_UTF8;
++ RExC_orig_utf8 = RExC_utf8 = pm->op_pmdynflags & PMdf_CMP_UTF8;
+
+- RExC_precomp = exp;
+ DEBUG_r({
+ if (!PL_colorset) reginitcolors();
+ PerlIO_printf(Perl_debug_log, "%sCompiling REx%s `%s%*s%s'\n",
+ PL_colors[4],PL_colors[5],PL_colors[0],
+- (int)(xend - exp), RExC_precomp, PL_colors[1]);
++ (int)(xend - exp), exp, PL_colors[1]);
+ });
++
++redo_first_pass:
++ RExC_precomp = exp;
+ RExC_flags = pm->op_pmflags;
+ RExC_sawback = 0;
+
+@@ -1783,6 +1787,17 @@
+ RExC_precomp = Nullch;
+ return(NULL);
+ }
++ if (RExC_utf8 && !RExC_orig_utf8) {
++ STRLEN len = xend-exp;
++ DEBUG_r(PerlIO_printf(Perl_debug_log,
++ "UTF8 mismatch! Converting to utf8 for resizing and compile\n"));
++ exp = (char*)Perl_bytes_to_utf8(aTHX_ (U8*)exp, &len);
++ xend = exp + len;
++ RExC_orig_utf8 = RExC_utf8;
++ SAVEFREEPV(exp);
++ goto redo_first_pass;
++ }
++