develooper Front page | perl.perl5.porters | Postings from March 2006

Uninitialized value in Archive::Tar

Thread Next
Randy W. Sims
March 20, 2006 03:38
Uninitialized value in Archive::Tar
Message ID:

In the _read_tar method of Archive::Tar, it calls 
Archive::Tar::File->new with a "chunk" which in turn calls its 
_new_from_chunk method. This method doesn't define its 'data' member, so 
later when it's referenced

   $data = $entry->get_content_by_ref;
   substr ($$data, $entry->size) = "";

we get an error calling substr on an undef value.

The attached patch provides a very localised fix for the problem, but I 
don't know the code well enough to say that it is the correct fix. It 
does eliminate the warnings and all tests pass.


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About