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>
1 file changed