2bb84c
From 4ee6d47e40a527e4c233362109985a421d784c2d Mon Sep 17 00:00:00 2001
2bb84c
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
2bb84c
Date: Tue, 27 Sep 2016 16:03:16 +0200
2bb84c
Subject: [PATCH 2/2] Stringify tainted version object on perl older than
2bb84c
 5.17.2
2bb84c
MIME-Version: 1.0
2bb84c
Content-Type: text/plain; charset=UTF-8
2bb84c
Content-Transfer-Encoding: 8bit
2bb84c
2bb84c
Since version-0.9908, version->new() accepts tainted input after
2bb84c
4bac9ae47b5ad7845a24e26b0e95609805de688a change (Magic flags
2bb84c
harmonization) in perl 5.17.2.
2bb84c
2bb84c
But it cannot stringify resultin version object and returns undef
2bb84c
instead.
2bb84c
2bb84c
This patch adds support for the stringification.
2bb84c
2bb84c
CPAN RT#118087
2bb84c
2bb84c
Signed-off-by: Petr Písař <ppisar@redhat.com>
2bb84c
---
2bb84c
 vutil/vutil.c | 6 +++++-
2bb84c
 1 file changed, 5 insertions(+), 1 deletion(-)
2bb84c
2bb84c
diff --git a/vutil/vutil.c b/vutil/vutil.c
2bb84c
index c5edb10..f17fb0a 100644
2bb84c
--- a/vutil/vutil.c
2bb84c
+++ b/vutil/vutil.c
2bb84c
@@ -916,7 +916,11 @@ Perl_vstringify(pTHX_ SV *vs)
2bb84c
     if (svp) {
2bb84c
 	SV *pv;
2bb84c
 	pv = *svp;
2bb84c
-	if ( SvPOK(pv) )
2bb84c
+    if ( SvPOK(pv)
2bb84c
+#if PERL_VERSION_LT(5,17,2)
2bb84c
+         || SvPOKp(pv)
2bb84c
+#endif
2bb84c
+    )   
2bb84c
 	    return newSVsv(pv);
2bb84c
 	else
2bb84c
 	    return &PL_sv_undef;
2bb84c
-- 
2bb84c
2.7.4
2bb84c