fuzz问题修正

Signed-off-by: sunjiakun <sunjiakun5@huawei.com>
This commit is contained in:
sunjiakun 2024-07-29 15:24:56 +08:00
parent 5451c4fefc
commit 057a443080
28 changed files with 106 additions and 60 deletions

View File

@ -80,9 +80,9 @@ group("fuzztest") {
"fuzztest_information/remoteabilityinfo_fuzzer:RemoteAbilityInfoFuzzTest",
"fuzztest_others/GetExtResource_fuzzer:GetExtResourceFuzzTest",
"fuzztest_others/RemoveExtResource_fuzzer:RemoveExtResourceFuzzTest",
"fuzztest_others/aginghandlerchain_fuzzer:AgingHandlerChainFuzzerTest",
"fuzztest_others/agingrequest_fuzzer:AgingRequestFuzzerTest",
"fuzztest_others/agingutil_fuzzer:AgingUtilFuzzerTest",
"fuzztest_others/aginghandlerchain_fuzzer:AgingHandlerChainFuzzTest",
"fuzztest_others/agingrequest_fuzzer:AgingRequestFuzzTest",
"fuzztest_others/agingutil_fuzzer:AgingUtilFuzzTest",
"fuzztest_others/appservicefwkinstalleraddappprovisioninfo_fuzzer:AppServiceFwkInstallerAddAppProvisionInfoFuzzTest",
"fuzztest_others/appservicefwkinstallerbeforeinstall_fuzzer:AppServiceFwkInstallerBeforeInstallFuzzTest",
"fuzztest_others/appservicefwkinstallercheckandparsefiles_fuzzer:AppServiceFwkInstallerCheckAndParseFilesFuzzTest",
@ -94,7 +94,7 @@ group("fuzztest") {
"fuzztest_others/appservicefwkinstallerinstall_fuzzer:AppServiceFwkInstallerInstallFuzzTest",
"fuzztest_others/appservicefwkinstallermergebundleinfos_fuzzer:AppServiceFwkInstallerMergeBundleInfosFuzzTest",
"fuzztest_others/appservicefwkinstallermkdirifnotexist_fuzzer:AppServiceFwkInstallerMkdirIfNotExistFuzzTest",
"fuzztest_others/appservicefwkinstallermovesotorealpath_fuzzer:AppServiceFwkInstallerMoveSoToRealPath",
"fuzztest_others/appservicefwkinstallermovesotorealpath_fuzzer:AppServiceFwkInstallerMoveSoToRealPathFuzzTest",
"fuzztest_others/appservicefwkinstallerprocessinstall_fuzzer:AppServiceFwkInstallerProcessInstallFuzzTest",
"fuzztest_others/appservicefwkinstallerprocessnativelibrary_fuzzer:AppServiceFwkInstallerProcessNativeLibraryFuzzTest",
"fuzztest_others/appservicefwkinstallerremovebundlecodedir_fuzzer:AppServiceFwkInstallerRemoveBundleCodeDirFuzzTest",
@ -137,11 +137,11 @@ group("fuzztest") {
"fuzztest_others/basebundleinstalleruninstallbundlebyuninstallparam_fuzzer:BaseBundleInstallerUninstallBundleByUninstallParamFuzzTest",
"fuzztest_others/basebundleinstalleruninstallbundlemodule_fuzzer:BaseBundleInstallerUnInstallBundleModuleFuzzTest",
"fuzztest_others/beforeaddextresource_fuzzer:BeforeAddExtResourceFuzzTest",
"fuzztest_others/bmsecologicalrulemgrserviceclient_fuzzer:BmsEcologicalRulemgrServiceClientFuzzerTest",
"fuzztest_others/bmsecologicalrulemgrserviceclient_fuzzer:BmsEcologicalRulemgrServiceClientFuzzTest",
"fuzztest_others/bmsextensionclient_fuzzer:BmsExtensionClientFuzzTest",
"fuzztest_others/bundleagingmgr_fuzzer:BundleAgingMgrFuzzTest",
"fuzztest_others/bundlecloneinstaller_fuzzer:BundlecloneinstallerFuzzTest",
"fuzztest_others/bundleconnectabilitymgr_fuzzer:BundleConnectAbilityMgrFuzzerTest",
"fuzztest_others/bundleconnectabilitymgr_fuzzer:BundleConnectAbilityMgrFuzzTest",
"fuzztest_others/bundlemanagercallback_fuzzer:BundleManagerCallbackFuzzTest",
"fuzztest_others/bundlemanagercallbackproxy_fuzzer:BundleManagerCallbackProxyFuzzTest",
"fuzztest_others/bundlemanagercallbackstub_fuzzer:BundleManagerCallbackStubFuzzTest",
@ -151,11 +151,10 @@ group("fuzztest") {
"fuzztest_others/copyfiles_fuzzer:CopyFilesFuzzTest",
"fuzztest_others/copytotempdir_fuzzer:CopyToTempDirFuzzTest",
"fuzztest_others/createfd_fuzzer:CreateFdFuzzTest",
"fuzztest_others/defaultapphost_fuzzer:DefaultAppHostFuzzerTest",
"fuzztest_others/defaultapphostimpl_fuzzer:DefaultAppHostImplFuzzerTest",
"fuzztest_others/defaultappmgr_fuzzer:DefaultAppMgrFuzzerTest",
"fuzztest_others/defaultappproxy_fuzzer:DefaultAppProxyFuzzerTest",
"fuzztest_others/defaultapprdb_fuzzer:DefaultAppRdbFuzzerTest",
"fuzztest_others/defaultapphostimpl_fuzzer:DefaultAppHostImplFuzzTest",
"fuzztest_others/defaultappmgr_fuzzer:DefaultAppMgrFuzzTest",
"fuzztest_others/defaultappproxy_fuzzer:DefaultAppProxyFuzzTest",
"fuzztest_others/defaultapprdb_fuzzer:DefaultAppRdbFuzzTest",
"fuzztest_others/deleteappjumpcontrolrule_fuzzer:DeleteAppJumpControlRuleFuzzTest",
"fuzztest_others/deletequickfix_fuzzer:DeleteQuickFixFuzzTest",
"fuzztest_others/deleterulebycallerbundlename_fuzzer:DeleteRuleByCallerBundleNameFuzzTest",
@ -182,28 +181,28 @@ group("fuzztest") {
"fuzztest_others/preinstallexceptionmgr_fuzzer:PreInstallExceptionMgrFuzzTest",
"fuzztest_others/processaddextresource_fuzzer:ProcessAddExtResourceFuzzTest",
"fuzztest_others/quickfix_fuzzer:QuickFixFuzzTest",
"fuzztest_others/quickfixbootscanner_fuzzer:QuickFixBootScannerFuzzerTest",
"fuzztest_others/quickfixchecker_fuzzer:QuickFixCheckerFuzzerTest",
"fuzztest_others/quickfixdatamgr_fuzzer:QuickFixDataMgrFuzzerTest",
"fuzztest_others/quickfixbootscanner_fuzzer:QuickFixBootScannerFuzzTest",
"fuzztest_others/quickfixchecker_fuzzer:QuickFixCheckerFuzzTest",
"fuzztest_others/quickfixdatamgr_fuzzer:QuickFixDataMgrFuzzTest",
"fuzztest_others/quickfixdeleter_fuzzer:QuickFixDeleterFuzzTest",
"fuzztest_others/quickfixdeployer_fuzzer:QuickFixDeployerFuzzerTest",
"fuzztest_others/quickfixmanagerhost_fuzzer:QuickFixManagerHost",
"fuzztest_others/quickfixdeployer_fuzzer:QuickFixDeployerFuzzTest",
"fuzztest_others/quickfixmanagerhost_fuzzer:QuickFixManagerHostFuzzTest",
"fuzztest_others/quickfixmanagerhostipml_fuzzer:QuickFixManagerHostIpmlFuzzTest",
"fuzztest_others/quickfixmanagerrdb_fuzzer:QuickFixManagerrDbFuzzerTest",
"fuzztest_others/quickfixmanagerrdb_fuzzer:QuickFixManagerRdbFuzzTest",
"fuzztest_others/quickfixmgr_fuzzer:QuickFixMgrFuzzTest",
"fuzztest_others/quickfixstatuscallbackproxy_fuzzer:QuickFixStatusCallbackProxy",
"fuzztest_others/quickfixswitcher_fuzzer:QuickFixSwitcherFuzzerTest",
"fuzztest_others/quickfixstatuscallbackproxy_fuzzer:QuickFixStatusCallbackProxyFuzzTest",
"fuzztest_others/quickfixswitcher_fuzzer:QuickFixSwitcherFuzzTest",
"fuzztest_others/removeextresourcesdb_fuzzer:RemoveExtResourcesDbFuzzTest",
"fuzztest_others/resetbundleresourceicon_fuzzer:ResetBundleResourceIconFuzzTest",
"fuzztest_others/rollback_fuzzer:RollBackFuzzTest",
"fuzztest_others/savecurdynamicicon_fuzzer:SaveCurDynamicIconFuzzTest",
"fuzztest_others/sendbroadcast_fuzzer:SendBroadCastFuzzTest",
"fuzztest_others/servicecenterconnection_fuzzer:ServiceCenterConnectionFuzzerTest",
"fuzztest_others/servicecenterstatuscallback_fuzzer:ServiceCenterStatusCallbackFuzzerTest",
"fuzztest_others/servicecenterstatuscallbackstub_fuzzer:ServiceCenterStatusCallbackStubFuzzerTest",
"fuzztest_others/servicecenterconnection_fuzzer:ServiceCenterConnectionFuzzTest",
"fuzztest_others/servicecenterstatuscallback_fuzzer:ServiceCenterStatusCallbackFuzzTest",
"fuzztest_others/servicecenterstatuscallbackstub_fuzzer:ServiceCenterStatusCallbackStubFuzzTest",
"fuzztest_others/shortcutinfo_fuzzer:ShortcutInfoFuzzTest",
"fuzztest_others/switchquickfix_fuzzer:SwitchQuickFixFuzzTest",
"fuzztest_others/systemabilityhelper_fuzzer:SystemAbilityHelperFuzzerTest",
"fuzztest_others/systemabilityhelper_fuzzer:SystemAbilityHelperFuzzTest",
"fuzztest_others/updateextresourcesdb_fuzzer:UpdateExtResourcesDbFuzzTest",
"fuzztest_others/upgradeatomicservice_fuzzer:UpgradeAtomicServiceFuzzTest",
"fuzztest_others/verifycallingpermission_fuzzer:VerifyCallingPermissionFuzzTest",

View File

@ -16,7 +16,7 @@ import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni")
module_output_path = "bundle_framework/bundle_framework"
ohos_fuzztest("AgingHandlerChainFuzzerTest") {
ohos_fuzztest("AgingHandlerChainFuzzTest") {
use_exceptions = true
module_out_path = module_output_path
fuzz_config_file =
@ -53,8 +53,6 @@ ohos_fuzztest("AgingHandlerChainFuzzerTest") {
deps = [
"${base_path}:appexecfwk_base",
"${core_path}:appexecfwk_core",
"//third_party/googletest:gmock_main",
"//third_party/googletest:gtest_main",
]
include_dirs += [ "${services_path}/bundlemgr/include/aging" ]
deps += bundle_install_deps

View File

@ -16,7 +16,7 @@ import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni")
module_output_path = "bundle_framework/bundle_framework"
ohos_fuzztest("AgingRequestFuzzerTest") {
ohos_fuzztest("AgingRequestFuzzTest") {
use_exceptions = true
module_out_path = module_output_path
fuzz_config_file = "../../../fuzztest/fuzztest_others/agingrequest_fuzzer"
@ -52,8 +52,6 @@ ohos_fuzztest("AgingRequestFuzzerTest") {
deps = [
"${base_path}:appexecfwk_base",
"${core_path}:appexecfwk_core",
"//third_party/googletest:gmock_main",
"//third_party/googletest:gtest_main",
]
include_dirs += [ "${services_path}/bundlemgr/include/aging" ]
deps += bundle_install_deps

View File

@ -16,7 +16,7 @@ import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni")
module_output_path = "bundle_framework/bundle_framework"
ohos_fuzztest("AgingUtilFuzzerTest") {
ohos_fuzztest("AgingUtilFuzzTest") {
use_exceptions = true
module_out_path = module_output_path
fuzz_config_file = "../../../fuzztest/fuzztest_others/agingutil_fuzzer"
@ -52,8 +52,6 @@ ohos_fuzztest("AgingUtilFuzzerTest") {
deps = [
"${base_path}:appexecfwk_base",
"${core_path}:appexecfwk_core",
"//third_party/googletest:gmock_main",
"//third_party/googletest:gtest_main",
]
include_dirs += [ "${services_path}/bundlemgr/include/aging" ]
deps += bundle_install_deps

View File

@ -17,7 +17,7 @@ import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni")
module_output_path = fuzz_test_path
ohos_fuzztest("AppServiceFwkInstallerMoveSoToRealPath") {
ohos_fuzztest("AppServiceFwkInstallerMoveSoToRealPathFuzzTest") {
fuzz_config_file = "../../../fuzztest/fuzztest_others/appservicefwkinstallermovesotorealpath_fuzzer"
use_exceptions = true

View File

@ -16,7 +16,7 @@ import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni")
module_output_path = "bundle_framework/bundle_framework"
ohos_fuzztest("BmsEcologicalRulemgrServiceClientFuzzerTest") {
ohos_fuzztest("BmsEcologicalRulemgrServiceClientFuzzTest") {
fuzz_config_file = "../../../fuzztest/fuzztest_others/bmsecologicalrulemgrserviceclient_fuzzer"
use_exceptions = true
module_out_path = module_output_path

View File

@ -16,7 +16,7 @@ import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni")
module_output_path = "bundle_framework/bundle_framework"
ohos_fuzztest("BundleConnectAbilityMgrFuzzerTest") {
ohos_fuzztest("BundleConnectAbilityMgrFuzzTest") {
fuzz_config_file =
"../../../fuzztest/fuzztest_others/bundleconnectabilitymgr_fuzzer"
use_exceptions = true

View File

@ -16,7 +16,7 @@ import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni")
module_output_path = "bundle_framework/bundle_framework"
ohos_fuzztest("DefaultAppHostFuzzerTest") {
ohos_fuzztest("DefaultAppHostFuzzTest") {
use_exceptions = true
module_out_path = module_output_path
fuzz_config_file = "../../../fuzztest/fuzztest_others/defaultapphost_fuzzer"

View File

@ -16,7 +16,7 @@ import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni")
module_output_path = "bundle_framework/bundle_framework"
ohos_fuzztest("DefaultAppHostImplFuzzerTest") {
ohos_fuzztest("DefaultAppHostImplFuzzTest") {
fuzz_config_file =
"../../../fuzztest/fuzztest_others/defaultapphostimpl_fuzzer"
use_exceptions = true

View File

@ -16,7 +16,7 @@ import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni")
module_output_path = "bundle_framework/bundle_framework"
ohos_fuzztest("DefaultAppMgrFuzzerTest") {
ohos_fuzztest("DefaultAppMgrFuzzTest") {
fuzz_config_file = "../../../fuzztest/fuzztest_others/defaultappmgr_fuzzer"
use_exceptions = true
module_out_path = module_output_path

View File

@ -16,7 +16,7 @@ import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni")
module_output_path = "bundle_framework/bundle_framework"
ohos_fuzztest("DefaultAppProxyFuzzerTest") {
ohos_fuzztest("DefaultAppProxyFuzzTest") {
use_exceptions = true
module_out_path = module_output_path
fuzz_config_file = "../../../fuzztest/fuzztest_others/defaultappproxy_fuzzer"

View File

@ -16,7 +16,7 @@ import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni")
module_output_path = "bundle_framework/bundle_framework"
ohos_fuzztest("DefaultAppRdbFuzzerTest") {
ohos_fuzztest("DefaultAppRdbFuzzTest") {
fuzz_config_file = "../../../fuzztest/fuzztest_others/defaultapprdb_fuzzer"
use_exceptions = true
module_out_path = module_output_path

View File

@ -28,7 +28,7 @@ namespace OHOS {
bool DoSomethingInterestingWithMyAPI(const uint8_t *data, size_t size)
{
bool ret = false;
std::string type(reinterpret_cast<const char *>(data), size);
std::string type = "IMAGE";
BundleInfo bundleInfo;
Element element;

View File

@ -17,7 +17,7 @@ import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni")
module_output_path = "bundle_framework/bundle_framework"
ohos_fuzztest("QuickFixBootScannerFuzzerTest") {
ohos_fuzztest("QuickFixBootScannerFuzzTest") {
fuzz_config_file =
"../../../fuzztest/fuzztest_others/quickfixbootscanner_fuzzer"
use_exceptions = true

View File

@ -16,7 +16,7 @@ import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni")
module_output_path = "bundle_framework/bundle_framework"
ohos_fuzztest("QuickFixCheckerFuzzerTest") {
ohos_fuzztest("QuickFixCheckerFuzzTest") {
fuzz_config_file = "../../../fuzztest/fuzztest_others/quickfixchecker_fuzzer"
use_exceptions = true
module_out_path = module_output_path

View File

@ -26,11 +26,35 @@ constexpr size_t MESSAGE_SIZE = 4;
constexpr size_t DCAMERA_SHIFT_24 = 24;
constexpr size_t DCAMERA_SHIFT_16 = 16;
constexpr size_t DCAMERA_SHIFT_8 = 8;
const std::string BUNDLE_NAME = "com.example.bmsaccesstoken1";
const uint32_t QUICK_FIX_VERSION_CODE = 1;
const uint32_t BUNDLE_VERSION_CODE = 1;
const std::string QUICK_FIX_VERSION_NAME = "1.0";
const std::string BUNDLE_VERSION_NAME = "1.0";
uint32_t GetU32Data(const char* ptr)
{
return (ptr[0] << DCAMERA_SHIFT_24) | (ptr[1] << DCAMERA_SHIFT_16) | (ptr[2] << DCAMERA_SHIFT_8) | (ptr[3]);
}
AppQuickFix CreateAppQuickFix()
{
AppqfInfo appInfo;
appInfo.versionCode = QUICK_FIX_VERSION_CODE;
appInfo.versionName = QUICK_FIX_VERSION_NAME;
appInfo.type = QuickFixType::PATCH;
HqfInfo hqfInfo;
hqfInfo.moduleName = "entry";
hqfInfo.type = QuickFixType::PATCH;
appInfo.hqfInfos.push_back(hqfInfo);
AppQuickFix appQuickFix;
appQuickFix.bundleName = BUNDLE_NAME;
appQuickFix.versionCode = BUNDLE_VERSION_CODE;
appQuickFix.versionName = BUNDLE_VERSION_NAME;
appQuickFix.deployingAppqfInfo = appInfo;
return appQuickFix;
}
bool DoSomethingInterestingWithMyAPI(const char* data, size_t size)
{
QuickFixChecker quickFixChecker;
@ -38,7 +62,7 @@ bool DoSomethingInterestingWithMyAPI(const char* data, size_t size)
std::vector<Security::Verify::HapVerifyResult> hapVerifyRes;
quickFixChecker.CheckMultipleHqfsSignInfo(bundlePaths, hapVerifyRes);
std::unordered_map<std::string, AppQuickFix> infos;
const AppQuickFix &appQuickFix = infos.begin()->second;
AppQuickFix appQuickFix = CreateAppQuickFix();
infos.emplace("appQuickFix_1", appQuickFix);
quickFixChecker.CheckAppQuickFixInfos(infos);
quickFixChecker.CheckMultiNativeSo(infos);
@ -47,8 +71,7 @@ bool DoSomethingInterestingWithMyAPI(const char* data, size_t size)
quickFixChecker.CheckPatchWithInstalledBundle(appQuickFix, bundleInfo, provisionInfo);
quickFixChecker.CheckHotReloadWithInstalledBundle(appQuickFix, bundleInfo);
quickFixChecker.CheckSignatureInfo(bundleInfo, provisionInfo);
quickFixChecker.GetAppDistributionType(static_cast<Security::Verify::AppDistType>
(reinterpret_cast<uintptr_t>(data)));
quickFixChecker.GetAppDistributionType(Security::Verify::AppDistType::APP_GALLERY);
quickFixChecker.CheckCommonWithInstalledBundle(appQuickFix, bundleInfo);
quickFixChecker.CheckModuleNameExist(bundleInfo, infos);
quickFixChecker.GetAppProvisionType(Security::Verify::ProvisionType::DEBUG);

View File

@ -16,7 +16,8 @@ import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni")
module_output_path = "bundle_framework/bundle_framework"
ohos_fuzztest("QuickFixDataMgrFuzzerTest") {
ohos_fuzztest("QuickFixDataMgrFuzzTest") {
fuzz_config_file = "../../../fuzztest/fuzztest_others/quickfixdatamgr_fuzzer"
use_exceptions = true
module_out_path = module_output_path
include_dirs = [

View File

@ -16,7 +16,8 @@ import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni")
module_output_path = "bundle_framework/bundle_framework"
ohos_fuzztest("QuickFixDeployerFuzzerTest") {
ohos_fuzztest("QuickFixDeployerFuzzTest") {
fuzz_config_file = "../../../fuzztest/fuzztest_others/quickfixdeployer_fuzzer"
use_exceptions = true
module_out_path = module_output_path
include_dirs = [

View File

@ -27,6 +27,11 @@ constexpr size_t MESSAGE_SIZE = 4;
constexpr size_t DCAMERA_SHIFT_24 = 24;
constexpr size_t DCAMERA_SHIFT_16 = 16;
constexpr size_t DCAMERA_SHIFT_8 = 8;
const std::string BUNDLE_NAME = "com.example.bmsaccesstoken1";
const uint32_t QUICK_FIX_VERSION_CODE = 1;
const uint32_t BUNDLE_VERSION_CODE = 1;
const std::string QUICK_FIX_VERSION_NAME = "1.0";
const std::string BUNDLE_VERSION_NAME = "1.0";
void DoSomething2(const char* data, size_t size) {}
@ -34,6 +39,25 @@ uint32_t GetU32Data(const char* ptr)
{
return (ptr[0] << DCAMERA_SHIFT_24) | (ptr[1] << DCAMERA_SHIFT_16) | (ptr[2] << DCAMERA_SHIFT_8) | (ptr[3]);
}
AppQuickFix CreateAppQuickFix()
{
AppqfInfo appInfo;
appInfo.versionCode = QUICK_FIX_VERSION_CODE;
appInfo.versionName = QUICK_FIX_VERSION_NAME;
appInfo.type = QuickFixType::PATCH;
HqfInfo hqfInfo;
hqfInfo.moduleName = "entry";
hqfInfo.type = QuickFixType::PATCH;
appInfo.hqfInfos.push_back(hqfInfo);
AppQuickFix appQuickFix;
appQuickFix.bundleName = BUNDLE_NAME;
appQuickFix.versionCode = BUNDLE_VERSION_CODE;
appQuickFix.versionName = BUNDLE_VERSION_NAME;
appQuickFix.deployingAppqfInfo = appInfo;
return appQuickFix;
}
bool DoSomethingInterestingWithMyAPI(const char* data, size_t size)
{
std::string targetPath(data, size);
@ -58,12 +82,12 @@ bool DoSomethingInterestingWithMyAPI(const char* data, size_t size)
quickFixDeployer.GetBundleInfo(bundleName, bundleInfo);
quickFixDeployer.ProcessPatchDeployStart(bundleFilePaths, bundleInfo, infos);
std::unordered_map<std::string, AppQuickFix> infos1;
const AppQuickFix &appQuickFix = infos1.begin()->second;
const AppQuickFix appQuickFix = CreateAppQuickFix();
quickFixDeployer.ProcessHotReloadDeployStart(bundleInfo, appQuickFix);
quickFixDeployer.ProcessPatchDeployEnd(appQuickFix, targetPath);
quickFixDeployer.ProcessHotReloadDeployEnd(appQuickFix, targetPath);
AppQuickFix newAppQuickFix;
AppQuickFix oldAppQuickFix;
AppQuickFix newAppQuickFix = CreateAppQuickFix();
AppQuickFix oldAppQuickFix = CreateAppQuickFix();
quickFixDeployer.CheckPatchVersionCode(newAppQuickFix, oldAppQuickFix);
QuickFixMark mark;
mark.bundleName = appQuickFix.bundleName;

View File

@ -19,7 +19,7 @@ import("../../../../appexecfwk.gni")
module_output_path = fuzz_test_path
##############################fuzztest##########################################
ohos_fuzztest("QuickFixManagerHost") {
ohos_fuzztest("QuickFixManagerHostFuzzTest") {
module_out_path = module_output_path
fuzz_config_file =
"../../../fuzztest/fuzztest_others/quickfixmanagerhost_fuzzer"

View File

@ -16,7 +16,9 @@ import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni")
module_output_path = "bundle_framework/bundle_framework"
ohos_fuzztest("QuickFixManagerrDbFuzzerTest") {
ohos_fuzztest("QuickFixManagerRdbFuzzTest") {
fuzz_config_file =
"../../../fuzztest/fuzztest_others/quickfixmanagerrdb_fuzzer"
use_exceptions = true
module_out_path = module_output_path
include_dirs = [

View File

@ -19,7 +19,7 @@ import("../../../../appexecfwk.gni")
module_output_path = fuzz_test_path
##############################fuzztest##########################################
ohos_fuzztest("QuickFixStatusCallbackProxy") {
ohos_fuzztest("QuickFixStatusCallbackProxyFuzzTest") {
module_out_path = module_output_path
fuzz_config_file =
"../../../fuzztest/fuzztest_others/quickfixstatuscallbackproxy_fuzzer"

View File

@ -16,7 +16,8 @@ import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni")
module_output_path = "bundle_framework/bundle_framework"
ohos_fuzztest("QuickFixSwitcherFuzzerTest") {
ohos_fuzztest("QuickFixSwitcherFuzzTest") {
fuzz_config_file = "../../../fuzztest/fuzztest_others/quickfixswitcher_fuzzer"
use_exceptions = true
module_out_path = module_output_path
include_dirs = [

View File

@ -26,6 +26,7 @@ constexpr size_t U32_AT_SIZE = 4;
constexpr size_t DCAMERA_SHIFT_24 = 24;
constexpr size_t DCAMERA_SHIFT_16 = 16;
constexpr size_t DCAMERA_SHIFT_8 = 8;
const std::string BUNDLE_NAME = "com.example.l3jsdemo";
uint32_t GetU32Data(const char* ptr)
{
@ -33,7 +34,7 @@ uint32_t GetU32Data(const char* ptr)
}
bool DoSomethingInterestingWithMyAPI(const char* data, size_t size)
{
std::string bundleName(data, size);
std::string bundleName = BUNDLE_NAME;
QuickFixSwitcher quickFixSwitcher(bundleName, true);
quickFixSwitcher.Execute();
quickFixSwitcher.SwitchQuickFix();

View File

@ -16,7 +16,7 @@ import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni")
module_output_path = "bundle_framework/bundle_framework"
ohos_fuzztest("ServiceCenterConnectionFuzzerTest") {
ohos_fuzztest("ServiceCenterConnectionFuzzTest") {
use_exceptions = true
module_out_path = module_output_path
fuzz_config_file =

View File

@ -16,7 +16,7 @@ import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni")
module_output_path = "bundle_framework/bundle_framework"
ohos_fuzztest("ServiceCenterStatusCallbackFuzzerTest") {
ohos_fuzztest("ServiceCenterStatusCallbackFuzzTest") {
use_exceptions = true
module_out_path = module_output_path
fuzz_config_file =

View File

@ -16,7 +16,7 @@ import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni")
module_output_path = "bundle_framework/bundle_framework"
ohos_fuzztest("ServiceCenterStatusCallbackStubFuzzerTest") {
ohos_fuzztest("ServiceCenterStatusCallbackStubFuzzTest") {
fuzz_config_file =
"../../../fuzztest/fuzztest_others/servicecenterstatuscallbackstub_fuzzer"
use_exceptions = true

View File

@ -17,7 +17,7 @@ import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni")
module_output_path = "bundle_framework/bundle_framework"
ohos_fuzztest("SystemAbilityHelperFuzzerTest") {
ohos_fuzztest("SystemAbilityHelperFuzzTest") {
fuzz_config_file =
"../../../fuzztest/fuzztest_others/systemabilityhelper_fuzzer"
use_exceptions = true