From c06ec1a55315db02c4d717273002d2e84e2f5513 Mon Sep 17 00:00:00 2001 From: lvyuanyuan Date: Sat, 13 Apr 2024 17:05:24 +0800 Subject: [PATCH] mod afs fuzz test Signed-off-by: lvyuanyuan Change-Id: I9a362b6431c4060ae7cbe5537e8d0a7c8f939b44 --- .../svcrestoredepsmanager_fuzzer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/fuzztest/svcrestoredepsmanager_fuzzer/svcrestoredepsmanager_fuzzer.cpp b/test/fuzztest/svcrestoredepsmanager_fuzzer/svcrestoredepsmanager_fuzzer.cpp index 2891b1cd2..8850a1da2 100644 --- a/test/fuzztest/svcrestoredepsmanager_fuzzer/svcrestoredepsmanager_fuzzer.cpp +++ b/test/fuzztest/svcrestoredepsmanager_fuzzer/svcrestoredepsmanager_fuzzer.cpp @@ -75,7 +75,10 @@ void GetInfo(const uint8_t *data, size_t size, vector bundleInfos; - RestoreTypeEnum restoreType = *(reinterpret_cast(data)); + RestoreTypeEnum restoreType = RestoreTypeEnum::RESTORE_DATA_WAIT_SEND; + if (size >= sizeof(RestoreTypeEnum)) { + restoreType = *(reinterpret_cast(data)); + } SvcRestoreDepsManager::GetInstance().GetRestoreBundleNames(bundleInfos, restoreType); GetInfo(data, size, bundleInfos); -- Gitee