From 304000db793461b691e8db69205467eb7ee8d28d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Tue, 9 Jan 2018 15:40:40 +0100 Subject: [PATCH] Fix a crash when untying an object witout a stash --- ...id-a-segfault-when-untying-an-object.patch | 32 +++++++++++++++++++ perl.spec | 6 ++++ 2 files changed, 38 insertions(+) create mode 100644 perl-5.27.5-Avoid-a-segfault-when-untying-an-object.patch diff --git a/perl-5.27.5-Avoid-a-segfault-when-untying-an-object.patch b/perl-5.27.5-Avoid-a-segfault-when-untying-an-object.patch new file mode 100644 index 0000000..ba8cdfa --- /dev/null +++ b/perl-5.27.5-Avoid-a-segfault-when-untying-an-object.patch @@ -0,0 +1,32 @@ +From e7e69c85c7e8e0cb75b831e606ad4f26f18b11ff Mon Sep 17 00:00:00 2001 +From: Nicolas R +Date: Mon, 31 Oct 2016 11:53:17 -0600 +Subject: [PATCH] Avoid a segfault when untying an object +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Check if the tied object has a stash set +before calling UNTIE method. + +Signed-off-by: Petr Písař +--- + pp_sys.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pp_sys.c b/pp_sys.c +index 672e7de08e..6d4dd86b7f 100644 +--- a/pp_sys.c ++++ b/pp_sys.c +@@ -1017,7 +1017,7 @@ PP(pp_untie) + + if ((mg = SvTIED_mg(sv, how))) { + SV * const obj = SvRV(SvTIED_obj(sv, mg)); +- if (obj) { ++ if (obj && SvSTASH(obj)) { + GV * const gv = gv_fetchmethod_autoload(SvSTASH(obj), "UNTIE", FALSE); + CV *cv; + if (gv && isGV(gv) && (cv = GvCV(gv))) { +-- +2.13.6 + diff --git a/perl.spec b/perl.spec index 0a7ad73..bfd46d2 100644 --- a/perl.spec +++ b/perl.spec @@ -222,6 +222,9 @@ Patch65: perl-5.27.5-Carp-Don-t-choke-on-ISA-constant.patch # RT#131895, in upstream after 5.27.5 Patch66: perl-5.26.1-perl-131895-fail-stat-on-names-with-0-embedded.patch +# Fix a crash when untying an object witout a stash, in upstream after 5.27.5 +Patch67: perl-5.27.5-Avoid-a-segfault-when-untying-an-object.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 @@ -2803,6 +2806,7 @@ Perl extension for Version Objects %patch64 -p1 %patch65 -p1 %patch66 -p1 +%patch67 -p1 %patch200 -p1 %patch201 -p1 @@ -2843,6 +2847,7 @@ perl -x patchlevel.h \ 'Fedora Patch64: Fix an overflow when parsing a character range with no preceding character (RT#132245)' \ 'Fedora Patch65: Fix walking symbol table for ISA in Carp' \ 'Fedora Patch66: Fix handling file names with null bytes in stat and lstat functions (RT#131895)' \ + 'Fedora Patch67: Fix a crash when untying an object witout a stash' \ '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} @@ -5136,6 +5141,7 @@ popd - Fix walking symbol table for ISA in Carp - Fix handling file names with null bytes in stat and lstat functions (RT#131895) +- Fix a crash when untying an object witout a stash * Mon Sep 25 2017 Jitka Plesnikova - 4:5.26.1-401 - Update perl(:MODULE_COMPAT)