You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by st...@apache.org on 2013/03/14 10:25:34 UTC

svn commit: r1456372 - in /perl/modperl/trunk: Changes xs/Apache2/RequestIO/Apache2__RequestIO.h

Author: stevehay
Date: Thu Mar 14 09:25:34 2013
New Revision: 1456372

URL: http://svn.apache.org/r1456372
Log:
On Perl 5.17.9, t/apache/read2.t fails because an "uninitialized value"
warning is generated for the buffer being autovivified. This is because
the sv_setpvn() that's meant to vivify the buffer doesn't perform set
magic; the warning is generated by the immediately following SvPV_force().
Patch to fix this from rt.cpan.org #83922. [Zefram]

Modified:
    perl/modperl/trunk/Changes
    perl/modperl/trunk/xs/Apache2/RequestIO/Apache2__RequestIO.h

Modified: perl/modperl/trunk/Changes
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/Changes?rev=1456372&r1=1456371&r2=1456372&view=diff
==============================================================================
--- perl/modperl/trunk/Changes (original)
+++ perl/modperl/trunk/Changes Thu Mar 14 09:25:34 2013
@@ -12,6 +12,12 @@ Also refer to the Apache::Test changes l
 
 =item 2.0.8-dev
 
+On Perl 5.17.9, t/apache/read2.t fails because an "uninitialized value"
+warning is generated for the buffer being autovivified. This is because
+the sv_setpvn() that's meant to vivify the buffer doesn't perform set
+magic; the warning is generated by the immediately following SvPV_force().
+Patch to fix this from rt.cpan.org #83922. [Zefram]
+
 Fix t/perl/hash_attack.t to work with Perl 5.14.4, 5.16.3 etc, which
 contain a fix for CVE-2013-1667 (memory exhaustion with arbitrary hash
 keys). This resolves rt.perl.org #116863, from where the patch was taken.

Modified: perl/modperl/trunk/xs/Apache2/RequestIO/Apache2__RequestIO.h
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/Apache2/RequestIO/Apache2__RequestIO.h?rev=1456372&r1=1456371&r2=1456372&view=diff
==============================================================================
--- perl/modperl/trunk/xs/Apache2/RequestIO/Apache2__RequestIO.h (original)
+++ perl/modperl/trunk/xs/Apache2/RequestIO/Apache2__RequestIO.h Thu Mar 14 09:25:34 2013
@@ -227,6 +227,10 @@ apr_status_t mpxs_setup_client_block(req
 #define mpxs_should_client_block(r) \
     (r->read_length || ap_should_client_block(r))
 
+#ifndef sv_setpvn_mg
+#   define sv_setpvn_mg sv_setpvn
+#endif
+
 /* alias */
 #define mpxs_Apache2__RequestRec_READ(r, buffer, len, offset) \
     mpxs_Apache2__RequestRec_read(aTHX_ r, buffer, len, offset)
@@ -239,7 +243,7 @@ static SV *mpxs_Apache2__RequestRec_read
     STRLEN blen;
 
     if (!SvOK(buffer)) {
-        sv_setpvn(buffer, "", 0);
+        sv_setpvn_mg(buffer, "", 0);
     }
 
     (void)SvPV_force(buffer, blen); /* make it a valid PV */