加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0003-Fix-crash-for-nullptr-in-EstablishAuthChannel.patch 1.53 KB
一键复制 编辑 原始数据 按行查看 历史
虫儿飞 提交于 2024-03-27 16:50 . Fix crash while authenticating
From 0ed00210a137abe34c706bdb1058a7fe0bcb3dfe Mon Sep 17 00:00:00 2001
From: Wei Jiangang <wei_jiangang@hoperun.com>
Date: Thu, 28 Mar 2024 12:13:57 +0800
Subject: [PATCH] Fix crash for nullptr in EstablishAuthChannel
Signed-off-by: Wei Jiangang <wei_jiangang@hoperun.com>
---
.../implementation/src/authentication/dm_auth_manager.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/services/implementation/src/authentication/dm_auth_manager.cpp b/services/implementation/src/authentication/dm_auth_manager.cpp
index 4b0fbd91..2874bec6 100644
--- a/services/implementation/src/authentication/dm_auth_manager.cpp
+++ b/services/implementation/src/authentication/dm_auth_manager.cpp
@@ -426,7 +426,9 @@ int32_t DmAuthManager::EstablishAuthChannel(const std::string &deviceId)
LOGE("OpenAuthSession failed, stop the authentication");
authResponseContext_ = std::make_shared<DmAuthResponseContext>();
authResponseContext_->state = AuthState::AUTH_REQUEST_NEGOTIATE;
- authRequestContext_->reason = ERR_DM_AUTH_OPEN_SESSION_FAILED;
+ if (authRequestContext_ != nullptr) {
+ authRequestContext_->reason = ERR_DM_AUTH_OPEN_SESSION_FAILED;
+ }
if (authRequestState_ != nullptr) {
authRequestState_->TransitionTo(std::make_shared<AuthRequestFinishState>());
}
@@ -940,4 +942,4 @@ bool DmAuthManager::IsIdenticalAccount()
return true;
}
} // namespace DistributedHardware
-} // namespace OHOS
\ No newline at end of file
+} // namespace OHOS
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化