Skip to content

Commit

Permalink
Prevent TypeError when central directory offset is nil, raise Zip::Er…
Browse files Browse the repository at this point in the history
…ror instead
  • Loading branch information
zelivans committed Sep 23, 2018
1 parent d07b13a commit 0b1b650
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/zip/central_directory.rb
Expand Up @@ -117,6 +117,7 @@ def read_e_o_c_d(buf) #:nodoc:
end

def read_central_directory_entries(io) #:nodoc:
raise Error, 'Zip consistency problem with central directory entry offset' if @cdir_offset.nil?
begin
io.seek(@cdir_offset, IO::SEEK_SET)
rescue Errno::EINVAL
Expand Down

0 comments on commit 0b1b650

Please sign in to comment.