UniversalTime: better check for size on parse.

This commit is contained in:
Robert Haines 2019-10-27 17:10:01 +00:00
parent 65cfd8a9a5
commit a5e785c737
1 changed files with 3 additions and 1 deletions

View File

@ -35,8 +35,10 @@ module Zip
def merge(binstr)
return if binstr.empty?
size, content = initial_parse(binstr)
size || return
return if !size || size <= 0
@flag, mt, at, ct = content.unpack('Cl<l<l<')
mt && @mtime ||= ::Zip::DOSTime.at(mt)
at && @atime ||= ::Zip::DOSTime.at(at)