diff options
author | ThiƩbaud Weksteen <tweek@google.com> | 2021-01-25 15:33:09 +0100 |
---|---|---|
committer | ThiƩbaud Weksteen <tweek@google.com> | 2021-01-25 15:33:09 +0100 |
commit | 108d7544eff3aefb0f12f1d3d18771b186422d2f (patch) | |
tree | f0fe46078487689c2f01a2a9eae64c3f890e97ff | |
parent | c41086cfcaa0ba611648edfd972a50735aa1d363 (diff) | |
download | bloaty-108d7544eff3aefb0f12f1d3d18771b186422d2f.tar.gz |
Fix parsing of archives
ar files require the data to be 2-bytes aligned. Update the Consume
method to read an even number of bytes. The consumption of the header is
unaltered as it is 60 bytes long.
-rw-r--r-- | src/elf.cc | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -655,6 +655,7 @@ class ArFile { private: string_view Consume(size_t n) { + n = (n % 2 == 0 ? n : n + 1); if (remaining_.size() < n) { THROW("premature end of file"); } |