From 1e8061ae22c3b9326d859fbf06cabd11e9521e6a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com>
Date: Fri, 16 Jun 2017 14:34:04 +0200
Subject: Fix improper casting of a negative interger to unsigned eith-bit type

---
 ...UTF8-code-improperly-casting-negative-int.patch | 33 ++++++++++++++++++++++
 perl.spec                                          |  7 +++++
 2 files changed, 40 insertions(+)
 create mode 100644 
perl-5.27.0-Fix-131190-UTF8-code-improperly-casting-negative-int.patch

diff --git 
a/perl-5.27.0-Fix-131190-UTF8-code-improperly-casting-negative-int.patch 
b/perl-5.27.0-Fix-131190-UTF8-code-improperly-casting-negative-int.patch
new file mode 100644
index 0000000..f248720
--- /dev/null
+++ b/perl-5.27.0-Fix-131190-UTF8-code-improperly-casting-negative-int.patch
@@ -0,0 +1,33 @@
+From 2c2da8e7f0f6325fab643997a536072633fa0cf8 Mon Sep 17 00:00:00 2001
+From: Yves Orton <demer...@gmail.com>
+Date: Thu, 1 Jun 2017 14:51:44 +0200
+Subject: [PATCH] Fix #131190 - UTF8 code improperly casting negative integer
+ to U8 in comparison
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This reverts commit b4972372a75776de3c9e6bd234a398d103677316,
+effectively restoring commit ca7eb79a236b41b7722c6800527f95cd76843eed,
+and commit 85fde2b7c3f5631fd982f5db735b84dc9224bec0.
+
+Signed-off-by: Petr Písař <ppi...@redhat.com>
+---
+ regexec.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/regexec.c b/regexec.c
+index 82128a7..35b88d7 100644
+--- a/regexec.c
++++ b/regexec.c
+@@ -5593,6 +5593,7 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, 
regnode *prog)
+                 if (scan->flags == EXACTL || scan->flags == EXACTFLU8) {
+                     _CHECK_AND_WARN_PROBLEMATIC_LOCALE;
+                     if (utf8_target
++                        && nextchr >= 0 /* guard against negative EOS value 
in nextchr */
+                         && UTF8_IS_ABOVE_LATIN1(nextchr)
+                         && scan->flags == EXACTL)
+                     {
+-- 
+2.9.4
+
diff --git a/perl.spec b/perl.spec
index 2e5a5a2..4171679 100644
--- a/perl.spec
+++ b/perl.spec
@@ -145,6 +145,10 @@ Patch31:        
perl-5.27.0-perl-131211-fixup-File-Glob-degenerate-matching.patc
 # in upstream after 5.27.0
 Patch32:        perl-5.27.0-perl-131085-Crash-with-sub-in-stash.patch
 
+# Fix an improper cast of a negative integer to an unsigned 8-bit type,
+# RT#131190, in upstream after 5.27.0
+Patch33:        
perl-5.27.0-Fix-131190-UTF8-code-improperly-casting-negative-int.patch
+
 # Link XS modules to libperl.so with EU::CBuilder on Linux, bug #960048
 Patch200:       
perl-5.16.3-Link-XS-modules-to-libperl.so-with-EU-CBuilder-on-Li.patch
 
@@ -2795,6 +2799,7 @@ Perl extension for Version Objects
 %patch30 -p1
 %patch31 -p1
 %patch32 -p1
+%patch33 -p1
 %patch200 -p1
 %patch201 -p1
 
@@ -2817,6 +2822,7 @@ perl -x patchlevel.h \
     'Fedora Patch30: Replace EU::MakeMaker dependency with EU::MM::Utils in 
IPC::Cmd (bug #1129443)' \
     'Fedora Patch31: Make File::Glob more resistant against degenerative 
matching (RT#131211)' \
     'Fedora Patch32: Fix a crash when calling a subroutine from a stash 
(RT#131085)' \
+    'Fedora Patch33: Fix an improper cast of a negative integer to an unsigned 
8-bit type (RT#131190)' \
     'Fedora Patch200: Link XS modules to libperl.so with EU::CBuilder on 
Linux' \
     'Fedora Patch201: Link XS modules to libperl.so with EU::MM on Linux' \
     %{nil}
@@ -5102,6 +5108,7 @@ popd
 * Fri Jun 16 2017 Petr Pisar <ppi...@redhat.com> - 4:5.26.0-394
 - Make File::Glob more resistant against degenerative matching (RT#131211)
 - Fix a crash when calling a subroutine from a stash (RT#131085)
+- Fix an improper cast of a negative integer to an unsigned 8-bit type 
(RT#131190)
 
 * Tue Jun 06 2017 Jitka Plesnikova <jples...@redhat.com> - 4:5.26.0-393
 - Stop providing old perl(MODULE_COMPAT_5.24.*)
-- 
cgit v1.1


        
https://src.fedoraproject.org/cgit/perl.git/commit/?h=master&id=1e8061ae22c3b9326d859fbf06cabd11e9521e6a
_______________________________________________
perl-devel mailing list -- perl-devel@lists.fedoraproject.org
To unsubscribe send an email to perl-devel-le...@lists.fedoraproject.org

Reply via email to