diff --git a/app/Classes/Protocol/Binkp.php b/app/Classes/Protocol/Binkp.php index f3cd325..a1c38ae 100644 --- a/app/Classes/Protocol/Binkp.php +++ b/app/Classes/Protocol/Binkp.php @@ -663,7 +663,7 @@ final class Binkp extends BaseProtocol $offs = (int)$this->strsep($str,' '); $flags = $this->strsep($str,' '); - if ($name && $size && $time) { + if ($name && is_numeric($size) && $time) { return [ 'file'=>['name'=>$name,'size'=>$size,'mtime'=>$time], 'offs'=>$offs, @@ -918,6 +918,18 @@ final class Binkp extends BaseProtocol $this->recv->new($file['file'],$this->node->address,$this->force_queue); + // If the file is zero byte size, we'll skip it + if ($this->recv->recvsize === 0) { + Log::error(sprintf('%s:! SKIPPING zero byte file info [%s]',self::LOGKEY,$this->recv->nameas)); + + $this->msgs(self::BPM_SKIP,$this->recv->name_size_time); + + // Close the file, since we are skipping it. + $this->recv->close(); + + return TRUE; + } + try { switch ($this->recv->open($file['offs']<0,$file['flags'])) { case self::FOP_ERROR: