From 095ffaedc954a13303540957482e9c86a33b4ef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=99=AB=E5=84=BF=E9=A3=9E?= Date: Wed, 27 Mar 2024 08:16:03 +0000 Subject: [PATCH] Fix crash while authenticating MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 虫儿飞 --- 0003-fix-crash-while-authenticating.patch | 15 +++++++++++++++ device_manager.spec | 8 +++++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 0003-fix-crash-while-authenticating.patch diff --git a/0003-fix-crash-while-authenticating.patch b/0003-fix-crash-while-authenticating.patch new file mode 100644 index 0000000..e1d8178 --- /dev/null +++ b/0003-fix-crash-while-authenticating.patch @@ -0,0 +1,15 @@ +diff --git a/services/implementation/src/authentication/dm_auth_manager.cpp b/services/implementation/src/authentication/dm_auth_manager.cpp +index 4b0fbd912f1e89a738a2892da12d6573a7fe6d7e..517b1bf5c1fb2e52bfc108c8bda6a8b3daeee236 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(); + 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()); + } \ No newline at end of file diff --git a/device_manager.spec b/device_manager.spec index 6025318..da101e1 100644 --- a/device_manager.spec +++ b/device_manager.spec @@ -8,7 +8,7 @@ Name: distributedhardware_device_manager Version: 1.0.0 -Release: 3 +Release: 4 Summary: Distributed middleware used components. License: Apache-2.0 Url: https://gitee.com/openharmony/ @@ -20,6 +20,7 @@ Source5: device_manager.xml Patch1: 0001-remove-dependency-and-adapt-for-build-device_manager.patch Patch2: 0002-device-manager-only-support-for-network.patch +Patch3: 0003-fix-crash-while-authenticating.patch BuildRequires: gcc, make, hilog, kernel-devel, uname-build-checks BuildRequires: distributed-build, distributed-beget @@ -54,6 +55,7 @@ cp -rf %{_builddir}/build/openeuler/compiler_gn/* %{_builddir} %setup -q -D -T -a 1 -c -n %{distributedhardware_dir}/ %patch -P1 -p1 -d %{distributedhardware_dir}/device_manager %patch -P2 -p1 -d %{distributedhardware_dir}/device_manager +%patch -P3 -p1 -d %{distributedhardware_dir}/device_manager %setup -q -D -T -a 2 -c -n %{third_party_dir}/ @@ -116,12 +118,12 @@ ln -s /usr/include/device_manager %{buildroot}%{build_opt}/openeuler/compiler_gn /system/* %changelog +* Tue Mar 27 2024 wei_jiangang - 1.0.0-4 +- Fix crash while authenticating * Tue Mar 26 2024 tianhang - 1.0.0-3 - the auto parameter in device manager may cause the softbus to be abnormal - * Fri Dec 15 2023 heppen - 1.0.0-2 - Add SA profile - * Tue Oct 31 2023 Yuying Mu - 1.0.0-1 * Tue Nov 21 2023 Jiaqi Zhao - 1.0.0-1 - Init and adapt device manager to openEuler -- Gitee