Fix bug in code that grows the line reader buffer.
commitb20ced7b5460d61cb83013e871a9ab9789e11cf7
authorsimonb <simonb@chromium.org>
Thu, 8 Jan 2015 17:40:44 +0000 (8 09:40 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 8 Jan 2015 17:41:40 +0000 (8 17:41 +0000)
tree9689efe68e0e2d0d3683d3180064bd8e489eb50e
parent60e8018f8e429f5817036ca1bf36ec48b77d4dfb
Fix bug in code that grows the line reader buffer.

If buff_ is resized by realloc and did not originally point to
buff0_, then memcpy is called erroneously and with a byte count that
is larger than the size of buff0_.  This is a bug.

Fix by removing buff0_ and replacing it with code that allocates
buff_ on object construction or reset, so that buff_ can safely
be realloc'ed in all circumstances.

BUG=444714

Review URL: https://codereview.chromium.org/845513002

Cr-Commit-Position: refs/heads/master@{#310528}
third_party/android_crazy_linker/README.chromium
third_party/android_crazy_linker/src/src/crazy_linker_line_reader.cpp
third_party/android_crazy_linker/src/src/crazy_linker_line_reader.h