diff options
author | Jörgen Ekström <jorgen.ekstrom@sonyericsson.com> | 2011-03-24 15:09:42 +0100 |
---|---|---|
committer | Johan Redestig <johan.redestig@sonymobile.com> | 2014-11-07 13:41:06 +0000 |
commit | da44fe0e1f7c177cd65b7c5c80b35ec8fb3bc1c2 (patch) | |
tree | 125b68da3d72e46b95323493d0fbebfe39dd36b7 /tools/aapt/ResourceTable.cpp | |
parent | 59701b9ba5c453e327bc0e6873a9f6ff87a10391 (diff) |
Fixing NULL pointer access causing segmentation fault in aapt
In cases where resource packages are generated which does
not have public resources for all resource types - NULL
pointers sneaks into the mOrderedConfigs vector causing
the aapt tool to crash. The solution in this fix simply
ignores the NULL elements when later processing the sorted
vector.
The NULL elements are inserted during applyPublicEntryOrder
function call
Change-Id: I8b7135932e2d235018da2e2f7e09f0d22f1b2f59
Diffstat (limited to 'tools/aapt/ResourceTable.cpp')
-rw-r--r-- | tools/aapt/ResourceTable.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp index 4cca57fdecb1..0ec1aebb8b40 100644 --- a/tools/aapt/ResourceTable.cpp +++ b/tools/aapt/ResourceTable.cpp @@ -3009,7 +3009,7 @@ status_t ResourceTable::flatten(Bundle* bundle, const sp<const ResourceFilter>& // We need to write one type chunk for each configuration for // which we have entries in this type. - const size_t NC = t->getUniqueConfigs().size(); + const size_t NC = t != NULL ? t->getUniqueConfigs().size() : 0; const size_t typeSize = sizeof(ResTable_type) + sizeof(uint32_t)*N; |