Handle read(n) returning nil

Fixes Homebrew/homebrew#33090.
This commit is contained in:
Jack Nagel 2014-10-10 20:25:38 -05:00
parent 01397d17f7
commit a6df8785d8

View File

@ -60,7 +60,7 @@ module MachO
offsets = []
mach_data = []
header = read(8).unpack("N2")
header = (read(8) || "").unpack("N2")
case header[0]
when 0xcafebabe # universal
header[1].times do |i|