Fix improper casting of a negative interger to unsigned eith-bit type

This commit is contained in:
Petr Písař 2017-06-16 14:34:04 +02:00
parent 9900371245
commit 1e8061ae22
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,33 @@
From 2c2da8e7f0f6325fab643997a536072633fa0cf8 Mon Sep 17 00:00:00 2001
From: Yves Orton <demerphq@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ř <ppisar@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

View File

@ -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 <ppisar@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 <jplesnik@redhat.com> - 4:5.26.0-393
- Stop providing old perl(MODULE_COMPAT_5.24.*)