From 8fdaf5ee74d2c25e0925e4618b3b41f567f25f3c Mon Sep 17 00:00:00 2001 From: wangpggg Date: Mon, 16 Jun 2025 16:37:05 +0800 Subject: [PATCH] modify fuzz Signed-off-by: wangpeng --- .../fileaccessservicebaseproxy_fuzzer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/fuzztest/fileaccessservicebaseproxy_fuzzer/fileaccessservicebaseproxy_fuzzer.cpp b/test/fuzztest/fileaccessservicebaseproxy_fuzzer/fileaccessservicebaseproxy_fuzzer.cpp index 96242256..e00bfcdf 100644 --- a/test/fuzztest/fileaccessservicebaseproxy_fuzzer/fileaccessservicebaseproxy_fuzzer.cpp +++ b/test/fuzztest/fileaccessservicebaseproxy_fuzzer/fileaccessservicebaseproxy_fuzzer.cpp @@ -168,7 +168,7 @@ bool ConnectFileExtAbilityFuzzTest(sptr proxy, const uin bool UnregisterNotifyNoObserverFuzzTest(sptr proxy, const uint8_t* data, size_t size) { - if (data == nullptr || size < sizeof(bool)) { + if (data == nullptr || size < sizeof(bool) || g_fah == nullptr) { return true; } @@ -176,7 +176,7 @@ bool UnregisterNotifyNoObserverFuzzTest(sptr proxy, cons Uri uri(string(reinterpret_cast(data + pos), size - pos)); AAFwk::Want want; want.SetElementName(EXTERNAL_BNUDLE_NAME, "FileExtensionAbility"); - std::shared_ptr info = std::make_shared(want, g_fah->token_); + sptr info = sptr(new (std::nothrow) ConnectExtensionInfo(want, g_fah->token_)); proxy->UnregisterNotifyNoObserver(uri, *info); return true; } -- Gitee