Permalink
Browse files

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]

git-svn-id: https://svn.apache.org/repos/asf/perl/modperl/trunk@1456372 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 82b8d8b commit a21585e24fbe627cda2502307450105a6675e8a4 Steve Hay committed Mar 14, 2013
Showing with 11 additions and 1 deletion.
  1. +6 −0 Changes
  2. +5 −1 xs/Apache2/RequestIO/Apache2__RequestIO.h
View
@@ -12,6 +12,12 @@ Also refer to the Apache::Test changes log file, at Apache-Test/Changes
=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.
@@ -227,6 +227,10 @@ apr_status_t mpxs_setup_client_block(request_rec *r)
#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(pTHX_ request_rec *r,
STRLEN blen;
if (!SvOK(buffer)) {
- sv_setpvn(buffer, "", 0);
+ sv_setpvn_mg(buffer, "", 0);
}
(void)SvPV_force(buffer, blen); /* make it a valid PV */

0 comments on commit a21585e

Please sign in to comment.