diff --git a/0001-fix-coredump-Fix-coredump-problem-caused-by-nullpoin.patch b/0001-fix-coredump-Fix-coredump-problem-caused-by-nullpoin.patch new file mode 100644 index 0000000000000000000000000000000000000000..d1d97180c4536fc963e016aef4b51d7fc44c32ad --- /dev/null +++ b/0001-fix-coredump-Fix-coredump-problem-caused-by-nullpoin.patch @@ -0,0 +1,41 @@ +From 9b8ccb8e7e8f1d45315b984ecdbf0ab19870b3dd Mon Sep 17 00:00:00 2001 +From: tangjie02 +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 +--- + 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 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 + diff --git a/kiran-cc-daemon.spec b/kiran-cc-daemon.spec index e5abec00932f94994c8c358a34e9186d9be2c760..c41a48e25445af7f5676fd086c6e273bf7f3459e 100644 --- a/kiran-cc-daemon.spec +++ b/kiran-cc-daemon.spec @@ -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 - 2.3.1-2 +- KYOS-B: Fix coredump problem caused by nullpointer to SPwd. + * Thu Jul 28 2022 tangjie02 - 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)