summaryrefslogtreecommitdiff
path: root/libs/androidfw/tests/CommonHelpers.cpp
diff options
context:
space:
mode:
authorRyan Mitchell <rtmitchell@google.com>2020-11-16 23:08:18 +0000
committerRyan Mitchell <rtmitchell@google.com>2020-11-17 23:01:35 +0000
commitdb21f09a8e02bcfd3fefea68084667688268f1fa (patch)
treec9b22a2676936eaf56ee1160c9349632ccd7ba44 /libs/androidfw/tests/CommonHelpers.cpp
parent687f5e163f24ff31f822f986fd7a99b8832b6286 (diff)
Revert^2 "libandroidfw hardening for IncFs"
55ef6167a2c235bd88c7216238b2001b46795b79 Change-Id: I02d4890d181655dfd0a14c188468db512559d27b
Diffstat (limited to 'libs/androidfw/tests/CommonHelpers.cpp')
-rw-r--r--libs/androidfw/tests/CommonHelpers.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/androidfw/tests/CommonHelpers.cpp b/libs/androidfw/tests/CommonHelpers.cpp
index faa5350f9ecc..3396729536a4 100644
--- a/libs/androidfw/tests/CommonHelpers.cpp
+++ b/libs/androidfw/tests/CommonHelpers.cpp
@@ -58,8 +58,9 @@ const std::string& GetTestDataPath() {
}
std::string GetStringFromPool(const ResStringPool* pool, uint32_t idx) {
- String8 str = pool->string8ObjectAt(idx);
- return std::string(str.string(), str.length());
+ auto str = pool->string8ObjectAt(idx);
+ CHECK(str.has_value()) << "failed to find string entry";
+ return std::string(str->string(), str->length());
}
} // namespace android