not use list pointer after it has been deleted

This commit is contained in:
liuxinhao 2024-04-12 09:19:07 +08:00
parent ff3dccf596
commit 88bf1d33dc
2 changed files with 42 additions and 1 deletions

View File

@ -0,0 +1,37 @@
From e1e9ad9a49da04500206c526e0f9b8711a811a12 Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Thu, 11 Apr 2024 17:34:14 +0800
Subject: [PATCH] fix(bg): not use list pointer after it has been deleted
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复free后还错误的使用list指针的问题
---
libmate-desktop/mate-bg.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libmate-desktop/mate-bg.c b/libmate-desktop/mate-bg.c
index bdc93ee..2958e33 100644
--- a/libmate-desktop/mate-bg.c
+++ b/libmate-desktop/mate-bg.c
@@ -2006,13 +2006,14 @@ static gboolean
blow_expensive_caches (gpointer data)
{
MateBG *bg = data;
- GList *list;
+ GList *list,*next;
bg->blow_caches_id = 0;
if (bg->file_cache) {
- for (list = bg->file_cache; list != NULL; list = list->next) {
+ for (list = bg->file_cache; list != NULL; list = next) {
FileCacheEntry *ent = list->data;
+ next = list->next;
if (ent->type == PIXBUF) {
file_cache_entry_delete (ent);
--
2.33.0

View File

@ -17,7 +17,7 @@ Name: mate-desktop
License: GPLv2+ and LGPLv2+ and MIT
Version: %{branch}.2
%if 0%{?rel_build}
Release: 8
Release: 9
%else
Release: 0.10%{?git_rel}
%endif
@ -42,6 +42,7 @@ Patch1003: 0001-KYOS-B-Fix-mate-settings-daemon-crash.patch
Patch1004: 0001-add-the-gdk-window-scale-settings.patch
Patch1005: 0001-feature-lockdown-settings-Add-lockdown-settings-for-.patch
Patch1006: 0001-fix-xrandr-Fix-virtual-screens-not-recognized-72886b6a.patch
Patch1007: 0001-fix-bg-not-use-list-pointer-after-it-has-been-delete.patch
BuildRequires: dconf-devel
BuildRequires: desktop-file-utils
@ -247,6 +248,9 @@ install -m 644 %SOURCE5 %{buildroot}/%{_datadir}/applications/mate-mimeapps.list
%changelog
* Fri Apr 12 2024 liuxinhao <liuxinhao@kylinsec.com.cn> - 1.22.2-9
- KYOS-B: fix crash issue,not use list pointer after it has been deleted
* Wed Apr 10 2024 yangfeng <yangfeng@kylinsec.com.cn> - 1.22.2-8
- KYOS-F: changed requires to _vendor(#33548)