[Mimedefang] MIME::Parser in 5.414

Matthew.van.Eerde at hbinc.com Matthew.van.Eerde at hbinc.com
Tue Oct 19 17:41:37 EDT 2004


David F. Skoll wrote:
> On Tue, 19 Oct 2004, Staggs Mark - mstagg wrote:
> 
>> I'm using SOAP::Lite (which in turn uses MIME::Parser) with the
>> newest version of MIME::Tools.  In MIME::Parser.pm at line 789 the
>> 	line was changed to $ENCODED->flush or die ...;
>> In this case $ENCODED is an IO::ScalarArray whose flush is a no-op
>> and returns nothing (sub flush{}).  This causes the module to die
>> unnecessarily. 
> 
> This is IMO a bug in IO::ScalarArray, which should return "0 but
> true" for flush. 
> 
>> Can this be changed in future versions to not die and/or check for
>> ScalarArray type and not flush?
> 
> Well, I suppose it could, but there's nothing to stop someone from
> subclassing another class of IO::Handle and mis-implementing flush().
> This is a really nasty problem, because in many cases, it's a security
> risk *not* to check that flush() succeeds.  I don't know of a clean
> way to fix this (other than asking the Perl gods to fix
> IO::ScalarArray::flush.) 
> 
> Let me think about it a while.

Could you check $@? Maybe defined($ENCODED->flush) or die...?  How would you access the error if flush did error?

Matthew.van.Eerde (at) hbinc.com                 805.964.4554 x902
Hispanic Business Inc./HireDiversity.com         Software Engineer
perl -e"map{y/a-z/l-za-k/;print}shift" "Jjhi pcdiwtg Ptga wprztg,"




More information about the MIMEDefang mailing list