diff options
author | Alex Deymo <deymo@chromium.org> | 2015-06-26 17:17:05 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-06-30 12:22:15 +0000 |
commit | 914c446bfe8356f89b6a98174e5a073d237ea268 (patch) | |
tree | 471196b86705cefb470a31d33ee3826b703ef222 /payload_generator/filesystem_interface.h | |
parent | 2a9cb2af7c21b93f380d8ce28d932acdf6e25df7 (diff) |
update_engine: Fix bzip size types.
bzip.cc converted between int32_t and size_t while handling the size of
the passed buffer. While that works with normal values, passing a buffer
of 2GiB or more gets converted to a negative size, then extended to
a 64-bit negative number and then underflows to a 64bit huge value.
This patch uses size_t all the way to handle the buffer size avoiding
the signed/unsigned conversion. bzip2 interface uses an unsigned 32 bit
variable for the size, so we simply fail to compress/decompress blobs
that are 4GiB or bigger.
BUG=chromium:504447
TEST=Ran payload generator on an image with a 2GiB file on it.
Change-Id: I5176691b18d7fb378c677b511015f320ce3e9974
Reviewed-on: https://chromium-review.googlesource.com/282346
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Diffstat (limited to 'payload_generator/filesystem_interface.h')
0 files changed, 0 insertions, 0 deletions