From 0e61f7720c7d9b9922294453cb5da9f46cae744f Mon Sep 17 00:00:00 2001 From: daiyunlong Date: Thu, 31 Jul 2025 11:47:40 +0800 Subject: [PATCH] =?UTF-8?q?DTFuzz=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=8F=8A=E5=A4=B1=E8=B4=A5UT=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: daiyunlong --- .../src/authentication_v2/auth_stages/auth_pin_auth.cpp | 3 +++ .../commonfuzztest/authpinauth_fuzzer/auth_pin_auth_fuzzer.cpp | 1 - test/unittest/UTTest_device_manager_service_two.cpp | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/services/implementation/src/authentication_v2/auth_stages/auth_pin_auth.cpp b/services/implementation/src/authentication_v2/auth_stages/auth_pin_auth.cpp index 815401fec..e04cd9eba 100644 --- a/services/implementation/src/authentication_v2/auth_stages/auth_pin_auth.cpp +++ b/services/implementation/src/authentication_v2/auth_stages/auth_pin_auth.cpp @@ -513,6 +513,7 @@ int32_t AuthSrcPinInputState::ShowStartAuthDialog(std::shared_ptr int32_t AuthSrcPinInputState::Action(std::shared_ptr context) { LOGI("AuthSrcPinInputState::Action start"); + CHECK_NULL_RETURN(context, STOP_BIND); if (context->inputPinAuthFailTimes == 0) { auto ret = ShowStartAuthDialog(context); if (ret != DM_OK) { @@ -520,9 +521,11 @@ int32_t AuthSrcPinInputState::Action(std::shared_ptr context) } } else { // clear input pin box, and show try again + CHECK_NULL_RETURN(context->authUiStateMgr, STOP_BIND); context->authUiStateMgr->UpdateUiState(DmUiStateMsg::MSG_PIN_CODE_ERROR); } + CHECK_NULL_RETURN(context->authStateMachine, STOP_BIND); LOGI("AuthSrcPinInputState::Action waitting user operation"); // wait for user operation if (DmEventType::ON_USER_OPERATION != diff --git a/test/commonfuzztest/authpinauth_fuzzer/auth_pin_auth_fuzzer.cpp b/test/commonfuzztest/authpinauth_fuzzer/auth_pin_auth_fuzzer.cpp index 9c40d6255..d8bc89101 100644 --- a/test/commonfuzztest/authpinauth_fuzzer/auth_pin_auth_fuzzer.cpp +++ b/test/commonfuzztest/authpinauth_fuzzer/auth_pin_auth_fuzzer.cpp @@ -55,7 +55,6 @@ void AuthPinAuthFuzzTest(const uint8_t* data, size_t size) context->accesser.isGenerateLnnCredential = false; context->listener = std::make_shared(); auth4->ShowStartAuthDialog(context); - auth4->Action(context); auth5->GetStateType(); auth6->GetStateType(); auth7->GetStateType(); diff --git a/test/unittest/UTTest_device_manager_service_two.cpp b/test/unittest/UTTest_device_manager_service_two.cpp index cdf401b7c..7c658a6ab 100644 --- a/test/unittest/UTTest_device_manager_service_two.cpp +++ b/test/unittest/UTTest_device_manager_service_two.cpp @@ -1605,6 +1605,7 @@ HWTEST_F(DeviceManagerServiceTest, UpdateLocalServiceInfo_201, testing::ext::Tes DeviceManagerService::GetInstance().NotifyRemoteLocalUserSwitchByWifi(localUdid, wifiDevices, foregroundUserIds, backgroundUserIds); GTEST_LOG_(INFO) << "NotifyRemoteLocalUserSwitchByWifi end" ; + sleep(3); DeviceManagerService::GetInstance().softbusListener_ = nullptr; } -- Gitee