core: handle EOFError when checking checksum [GH-2716]

This commit is contained in:
Mitchell Hashimoto 2013-12-28 13:45:36 -07:00
parent 6e69f0542a
commit 7f78f18218
2 changed files with 10 additions and 2 deletions

View File

@ -5,6 +5,8 @@ BUG FIXES:
- core: The version for `Vagrant.configure` can now be an int. [GH-2689]
- core: `Vagrant.has_plugin?` tries to use plugin's gem name before
registered plugin name [GH-2617]
- core: Fix exception if an EOFError was somehow raised by Ruby while
checking a box checksum. [GH-2716]
## 1.4.1 (December 18, 2013)

View File

@ -28,8 +28,14 @@ class FileChecksum
File.open(@path, "r") do |f|
while !f.eof
buf = f.readpartial(BUFFER_SIZE)
digest.update(buf)
begin
buf = f.readpartial(BUFFER_SIZE)
digest.update(buf)
rescue EOFError
# Although we check for EOF earlier, this seems to happen
# sometimes anyways [GH-2716].
break
end
end
end