From 126a7ebead0bae49c1131256ddf4d0fa056d7e8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Mon, 2 Sep 2019 09:29:30 +0200 Subject: [PATCH] Fix parsing a Unicode property name when compiling a regular expression --- ....31.3-regcomp.c-Fix-wrong-limit-test.patch | 31 +++++++++++++++++++ perl.spec | 7 +++++ 2 files changed, 38 insertions(+) create mode 100644 perl-5.31.3-regcomp.c-Fix-wrong-limit-test.patch diff --git a/perl-5.31.3-regcomp.c-Fix-wrong-limit-test.patch b/perl-5.31.3-regcomp.c-Fix-wrong-limit-test.patch new file mode 100644 index 0000000..6d6b5d0 --- /dev/null +++ b/perl-5.31.3-regcomp.c-Fix-wrong-limit-test.patch @@ -0,0 +1,31 @@ +From 8d3e0237887e7149be56d17a9448cb465edc5f76 Mon Sep 17 00:00:00 2001 +From: Karl Williamson +Date: Thu, 22 Aug 2019 10:16:14 -0600 +Subject: [PATCH] regcomp.c: Fix wrong limit test +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Spotted by Hugo van der Sanden in code reading. + +Signed-off-by: Petr Písař +--- + regcomp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/regcomp.c b/regcomp.c +index aba6648da5..d61fd434fe 100644 +--- a/regcomp.c ++++ b/regcomp.c +@@ -23132,7 +23132,7 @@ Perl_parse_uniprop_string(pTHX_ + + /* If the original input began with 'In' or 'Is', it could be a subroutine + * call to a user-defined property instead of a Unicode property name. */ +- if ( non_pkg_begin + name_len > 2 ++ if ( name_len - non_pkg_begin > 2 + && name[non_pkg_begin+0] == 'I' + && (name[non_pkg_begin+1] == 'n' || name[non_pkg_begin+1] == 's')) + { +-- +2.21.0 + diff --git a/perl.spec b/perl.spec index 2642724..83b247c 100644 --- a/perl.spec +++ b/perl.spec @@ -263,6 +263,10 @@ Patch52: perl-5.31.2-perlapi-5.30-promise-not-met-change-to-5.32.patch # Do not run File-Find tests in parallel, fixed after 5.31.2 Patch53: perl-5.31.2-Run-tests-in-ext-File-Find-t-in-series.patch +# Fix parsing a Unicode property name when compiling a regular expression, +# fixed after 5.31.3 +Patch54: perl-5.31.3-regcomp.c-Fix-wrong-limit-test.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 @@ -2838,6 +2842,7 @@ Perl extension for Version Objects %patch51 -p1 %patch52 -p1 %patch53 -p1 +%patch54 -p1 %patch200 -p1 %patch201 -p1 @@ -2898,6 +2903,7 @@ perl -x patchlevel.h \ 'Fedora Patch51: Fix parsing a denominator when parsing a Unicode property name' \ 'Fedora Patch52: Fix a documentation about a future API change' \ 'Fedora Patch53: Do not run File-Find tests in parallel' \ + 'Fedora Patch54: Fix parsing a Unicode property name when compiling a regular expression' \ '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} @@ -5145,6 +5151,7 @@ popd %changelog * Mon Sep 02 2019 Petr Pisar - 4:5.30.0-445 - Adjust spec file to rpm-build-4.15.0-0.rc1.1 +- Fix parsing a Unicode property name when compiling a regular expression * Thu Aug 22 2019 Petr Pisar - 4:5.30.0-444 - Fix a NULL pointer dereference in PerlIOVia_pushed()