Commit b0d57ac2 authored by Tatsuhisa Yamaguchi's avatar Tatsuhisa Yamaguchi Committed by Commit Bot

Zip Archiver: Return error when failed to read in a file.

VolumeReaderJavaScriptStream::Seek() doesn't return error even when the
file is not readable. Also the error in Read() was not handled before.
This was causing infinite loop when the archive became inaccessible,
such as when the archive was deleted by the user.
This change adds error handling on Read().

Bug: 791924
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I2774e53ed25eea50e6abe62ec7c52f4237c24c25
Reviewed-on: https://chromium-review.googlesource.com/808524
Commit-Queue: Tatsuhisa Yamaguchi <yamaguchi@chromium.org>
Reviewed-by: default avatarYuki Awano <yawano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521989}
parent c97b3102
......@@ -108,7 +108,8 @@ uint32_t CustomArchiveRead(void* archive,
archive_minizip->dynamic_cache_offset_ +
archive_minizip->dynamic_cache_size_ <
offset + size) {
volume_archive_functions::DynamicCache(archive_minizip, size);
if (volume_archive_functions::DynamicCache(archive_minizip, size) < 0)
return -1 /* Error */;
}
// Just copy the required data from the cache.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment