[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    [PATCH] $r->print won't print reference to PVIV or PVMG
From:       Stephen Clouse <stephenc () theiqgroup ! com>
Date:       2001-08-29 2:06:14
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


There's a bug in the write_client routine where it won't print a reference to a 
scalar that has been upgraded from a PV.  A string comparison will usually 
trigger an upgrade to PVIV.  Additionally, with PerlTaintCheck on, a tainted 
scalar will be a PVMG, because the tainted flag is magic.  At first I thought 
the latter could be intentional behavior, but passing the string itself instead 
of a reference was allowed, so it appears to be just an oversight.  The attached 
patch fixes both of these cases.

-- 
Stephen Clouse <stephenc@theiqgroup.com>
Senior Programmer, IQ Coordinator Project Lead
The IQ Group, Inc. <http://www.theiqgroup.com/>

["mod_perl_pv.patch" (text/plain)]

diff -ru mod_perl-1.26.orig/src/modules/perl/Apache.xs \
                mod_perl-1.26/src/modules/perl/Apache.xs
--- mod_perl-1.26.orig/src/modules/perl/Apache.xs	Fri Jul  6 15:15:04 2001
+++ mod_perl-1.26/src/modules/perl/Apache.xs	Tue Aug 28 20:47:37 2001
@@ -1171,7 +1171,7 @@
 
     for(i = 1; i <= items - 1; i++) {
 	int sent = 0;
-        SV *sv = SvROK(ST(i)) && (SvTYPE(SvRV(ST(i))) == SVt_PV) ?
+        SV *sv = SvROK(ST(i)) && (SvTYPE(SvRV(ST(i))) == SVt_PV || \
SvTYPE(SvRV(ST(i))) == SVt_PVIV || SvTYPE(SvRV(ST(i))) == SVt_PVMG) ?  \
(SV*)SvRV(ST(i)) : ST(i);  buffer = SvPV(sv, len);
 #ifdef APACHE_SSL


[Attachment #6 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic