summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2014-09-09 23:15:07 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-09-09 23:15:08 +0000
commite7ad74f070559336e9ad67897553e34a9c584242 (patch)
tree8fb3e335bbeedb3378a6e43c57e3f8f0ce3e2e07 /tools
parenta7cbaeb138b280b51f282a371cd11c65c0d05d1b (diff)
parent3fb8c9b50ef1873454acf3a4e7fd33ad182c03d7 (diff)
downloadframeworks_base-e7ad74f070559336e9ad67897553e34a9c584242.zip
frameworks_base-e7ad74f070559336e9ad67897553e34a9c584242.tar.gz
frameworks_base-e7ad74f070559336e9ad67897553e34a9c584242.tar.bz2
Merge "AAPT: Don't crash on illegal symbol name" into lmp-dev
Diffstat (limited to 'tools')
-rw-r--r--tools/aapt/ResourceTable.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp
index b3c364b..8341de6 100644
--- a/tools/aapt/ResourceTable.cpp
+++ b/tools/aapt/ResourceTable.cpp
@@ -2574,8 +2574,12 @@ status_t ResourceTable::addSymbols(const sp<AaptSymbols>& outSymbols) {
continue;
}
const size_t N = t->getOrderedConfigs().size();
- sp<AaptSymbols> typeSymbols;
- typeSymbols = outSymbols->addNestedSymbol(String8(t->getName()), t->getPos());
+ sp<AaptSymbols> typeSymbols =
+ outSymbols->addNestedSymbol(String8(t->getName()), t->getPos());
+ if (typeSymbols == NULL) {
+ return UNKNOWN_ERROR;
+ }
+
for (size_t ci=0; ci<N; ci++) {
sp<ConfigList> c = t->getOrderedConfigs().itemAt(ci);
if (c == NULL) {