summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author xndcn <xndchn@gmail.com> 2025-03-05 11:22:20 +0800
committer xndcn <xndchn@gmail.com> 2025-03-05 11:39:01 +0800
commit7ac48df14493665922c3746fecccad3794e6ae34 (patch)
treeab32e9a544304c893c3566f5ed6d05db51eeb3f0
parent2a6357c5377a6d793f8f0038f2c821eeba197e16 (diff)
Fix incorrect NULL check in IncFsFileMap reference assertions
Since IncFsFileMap&& is not a pointer type, the check should verify the validity of its underlying data. Change-Id: Ica43ab671831b3e3bb61472e0446aa6dbf51ba91
-rw-r--r--libs/androidfw/Asset.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/androidfw/Asset.cpp b/libs/androidfw/Asset.cpp
index 5a4cff0c319e..4e820b6857a1 100644
--- a/libs/androidfw/Asset.cpp
+++ b/libs/androidfw/Asset.cpp
@@ -453,7 +453,7 @@ status_t _FileAsset::openChunk(incfs::IncFsFileMap&& dataMap, base::unique_fd fd
{
assert(mFp == NULL); // no reopen
assert(!mMap.has_value());
- assert(dataMap != NULL);
+ assert(dataMap.data());
mMap = std::move(dataMap);
mStart = -1; // not used
@@ -798,7 +798,7 @@ status_t _CompressedAsset::openChunk(incfs::IncFsFileMap&& dataMap, size_t uncom
{
assert(mFd < 0); // no re-open
assert(!mMap.has_value());
- assert(dataMap != NULL);
+ assert(dataMap.data());
mMap = std::move(dataMap);
mStart = -1; // not used