summaryrefslogtreecommitdiff
path: root/tools/aapt/ResourceTable.cpp
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2014-09-09 16:05:10 -0700
committerAdam Lesinski <adamlesinski@google.com>2014-09-09 16:05:10 -0700
commit3fb8c9b50ef1873454acf3a4e7fd33ad182c03d7 (patch)
treedec5449bab1566ca938ba1a3d81f39c064a36458 /tools/aapt/ResourceTable.cpp
parent97e75e1da97f01e82c0105b1f915821a99dda196 (diff)
AAPT: Don't crash on illegal symbol name
We never checked the return value when adding a nested symbol, which would be NULL if the symbol name was invalid. External bug: https://code.google.com/p/android/issues/detail?id=75876 Change-Id: I5211f4d4b87897d52f2b6e5907113d31930bb92d
Diffstat (limited to 'tools/aapt/ResourceTable.cpp')
-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 b3c364be2451..8341de6c4ba5 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) {