develooper Front page | perl.perl5.porters | Postings from August 2001

Re: [ID 20010730.010] FETCH called twice with -T

Thread Previous | Thread Next
From:
Jarkko Hietaniemi
Date:
August 12, 2001 07:59
Subject:
Re: [ID 20010730.010] FETCH called twice with -T
Message ID:
20010812095928.K23329@chaos.wustl.edu
On Sat, Aug 11, 2001 at 06:18:19AM +0530, Abhijit Menon-Sen wrote:
> At 2001-07-30 20:05:27, abigail@foad.org wrote:
> > 
> > That is, the first time a tied scalar is fetched, it is fetched twice.
> 
> This happens when the return value from FETCH is tainted. The FETCH adds
> taint magic to the SV, which confuses mg_get() into walking the linked
> list of magic twice.
> 
> This patch makes mg_get() a lot smarter about handling changes to the
> list while it's running. It fixes the problem and passes all tests, but
> I'd appreciate reviews, since it's not an entirely trivial change.

Thanks, applied.

> Incidentally:
> 
> 1. Does the SV ever actually get upgraded, as the old comments suggest?
>    When? (I can find nothing in the core which does this.)
> 
> 2. Does anything depend in particular upon the order in which the magic
>    vtbl functions are called? I first tried was changing sv_magic() to
>    add to the end of the list instead, but that broke a lot of things
>    (which I think I'll go back and investigate.)

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About