OSDN Git Service

Fix BufferOverflowException when merging dexes
authorBenoit Lamarche <benoitlamarche@google.com>
Wed, 27 Nov 2013 15:38:17 +0000 (16:38 +0100)
committerYohann Roussel <yroussel@google.com>
Tue, 3 Dec 2013 13:04:48 +0000 (13:04 +0000)
commit4afbba6ebbd7b71774a09a9d74f2ee30352d64a1
tree442ce7d397f15d6a73f60c463f375c244af7812c
parent6e21232cf2bca0e73bd418413564cb140ab9ccbd
Fix BufferOverflowException when merging dexes

Bug: 11519714

The bug was due to the fact that when merging 2 dexes, not enough size may be reserved for the "typeLists" section.
This is because we only aligned the sum of the size of both sections.
If both typeLists sections were aligned with 2 and not with 4, we are 4 bytes short when writing.

Change-Id: I73b51eb25434a622143011741a69b88d42507f43
(cherry picked from commit 2241dbe132cf90b58f93c014bdd807405b7f82f5)
dx/src/com/android/dx/merge/DexMerger.java