Fix coredump problem caused by nullpointer to SPwd
Modify license to MulanPSL-2.0 in SPEC Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
This commit is contained in:
parent
437cb2387c
commit
5bbc75a3dc
@ -0,0 +1,41 @@
|
||||
From 9b8ccb8e7e8f1d45315b984ecdbf0ab19870b3dd Mon Sep 17 00:00:00 2001
|
||||
From: tangjie02 <tangjie02@kylinsec.com.cn>
|
||||
Date: Tue, 9 Aug 2022 10:45:00 +0800
|
||||
Subject: [PATCH] fix(coredump): Fix coredump problem caused by nullpointer to
|
||||
SPwd
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 修复由于访问SPwd空指针引起的崩溃问题。
|
||||
|
||||
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
|
||||
---
|
||||
plugins/accounts/accounts-wrapper.cpp | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/plugins/accounts/accounts-wrapper.cpp b/plugins/accounts/accounts-wrapper.cpp
|
||||
index 2cbee6c..4f313f6 100644
|
||||
--- a/plugins/accounts/accounts-wrapper.cpp
|
||||
+++ b/plugins/accounts/accounts-wrapper.cpp
|
||||
@@ -42,13 +42,14 @@ std::vector<PasswdShadow> AccountsWrapper::get_passwds_shadows()
|
||||
for (auto iter = this->passwds_.begin(); iter != this->passwds_.end(); ++iter)
|
||||
{
|
||||
auto spwd = this->spwds_.find(iter->first);
|
||||
- if (spwd == this->spwds_.end())
|
||||
+ // 如果spwd不存在,可能是因为账户正在创建中,这个时候不作为返回值,避免出现处理空指针引起的崩溃问题
|
||||
+ if (spwd != this->spwds_.end())
|
||||
{
|
||||
- passwds_shadows.push_back(std::make_pair(iter->second, nullptr));
|
||||
+ passwds_shadows.push_back(std::make_pair(iter->second, spwd->second));
|
||||
}
|
||||
else
|
||||
{
|
||||
- passwds_shadows.push_back(std::make_pair(iter->second, spwd->second));
|
||||
+ KLOG_DEBUG("The shadow info isn't found.");
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
Name: kiran-cc-daemon
|
||||
Version: 2.3.1
|
||||
Release: 1
|
||||
Release: 2
|
||||
Summary: DBus daemon for Kiran Desktop
|
||||
|
||||
License: Mulan PSL v2
|
||||
License: MulanPSL-2.0
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
|
||||
Patch0001: 0001-fix-coredump-Fix-coredump-problem-caused-by-nullpoin.patch
|
||||
|
||||
|
||||
BuildRequires: cmake >= 3.2
|
||||
BuildRequires: pkgconfig(glibmm-2.4)
|
||||
@ -144,6 +146,9 @@ glib-compile-schemas /usr/share/glib-2.0/schemas &> /dev/nulls || :
|
||||
%{_libdir}/pkgconfig/kiran-cc-daemon.pc
|
||||
|
||||
%changelog
|
||||
* Tue Aug 09 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.1-2
|
||||
- KYOS-B: Fix coredump problem caused by nullpointer to SPwd.
|
||||
|
||||
* Thu Jul 28 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.1-1
|
||||
- KYOS-B: Fix the problem that system version shows empty content in comunity version. (#I5H4D6)
|
||||
- KYOS-B: Fix the problem that system and sound classes in keybindings aren't shown.(#I5I6OU)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user