brong / Archive-Tar-Stream

pure perl IO-friendly tar file management
2 stars 3 forks source link

infinite loop on currupted input #5

Open gitcnd opened 5 years ago

gitcnd commented 5 years ago

Around line 400, this statement:-

unless ($n) {

results in an endless loop, because the earlier sysread above returns $n=-1 on particular corrupted gzip input.

This better substitute fixes the problem:

if ($n<1) {