From 7ac48df14493665922c3746fecccad3794e6ae34 Mon Sep 17 00:00:00 2001 From: xndcn Date: Wed, 5 Mar 2025 11:22:20 +0800 Subject: 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 --- libs/androidfw/Asset.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libs/androidfw') 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 -- cgit v1.2.3-59-g8ed1b