Skip to content

Commit

Permalink
On Perl 5.17.9, t/apache/read2.t fails because an "uninitialized value"
Browse files Browse the repository at this point in the history
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
Steve Hay committed Mar 14, 2013
1 parent 82b8d8b commit a21585e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Changes
Expand Up @@ -12,6 +12,12 @@ Also refer to the Apache::Test changes log file, at Apache-Test/Changes


=item 2.0.8-dev =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 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 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. keys). This resolves rt.perl.org #116863, from where the patch was taken.
Expand Down
6 changes: 5 additions & 1 deletion xs/Apache2/RequestIO/Apache2__RequestIO.h
Expand Up @@ -227,6 +227,10 @@ apr_status_t mpxs_setup_client_block(request_rec *r)
#define mpxs_should_client_block(r) \ #define mpxs_should_client_block(r) \
(r->read_length || ap_should_client_block(r)) (r->read_length || ap_should_client_block(r))


#ifndef sv_setpvn_mg
# define sv_setpvn_mg sv_setpvn
#endif

/* alias */ /* alias */
#define mpxs_Apache2__RequestRec_READ(r, buffer, len, offset) \ #define mpxs_Apache2__RequestRec_READ(r, buffer, len, offset) \
mpxs_Apache2__RequestRec_read(aTHX_ r, buffer, len, offset) mpxs_Apache2__RequestRec_read(aTHX_ r, buffer, len, offset)
Expand All @@ -239,7 +243,7 @@ static SV *mpxs_Apache2__RequestRec_read(pTHX_ request_rec *r,
STRLEN blen; STRLEN blen;


if (!SvOK(buffer)) { if (!SvOK(buffer)) {
sv_setpvn(buffer, "", 0); sv_setpvn_mg(buffer, "", 0);
} }


(void)SvPV_force(buffer, blen); /* make it a valid PV */ (void)SvPV_force(buffer, blen); /* make it a valid PV */
Expand Down

0 comments on commit a21585e

Please sign in to comment.