OSDN Git Service

Prevent integer overflow when calculating buffer resizes
authorChristopher Tate <ctate@google.com>
Mon, 8 Jun 2015 21:45:14 +0000 (14:45 -0700)
committerChristopher Tate <ctate@google.com>
Mon, 8 Jun 2015 21:49:09 +0000 (14:49 -0700)
commited7a50cc7d490ae7aece2d16422c5f7941876468
treea8c6d660d656e0d5a79cb2ed20f859b8a86e1426
parent98e67d352b8805a868ca0e7c2be3ea830fb7c338
Prevent integer overflow when calculating buffer resizes

Make sure that we don't go haywire if an exponential buffer growth
operation winds up wrapping integer range.  Along the way, fix a
bookkeeping bug in BufferedTextOutput that would cause it to keep
spuriously realloc()ing on every append().

Bug 20674694

Change-Id: Ia845b7de36b90672a151a918ffc26c7da68e20a2
libs/binder/BufferedTextOutput.cpp
libs/binder/Parcel.cpp