fix segfault if CreateGC failed in XaceHook

This commit is contained in:
niuwanli 2024-02-05 10:59:45 +08:00
parent 6d079019a2
commit 1629924afe
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,35 @@
From 9b1bb4a69190aaecafcbcafd97f6b42811c6e14b Mon Sep 17 00:00:00 2001
From: niuwanli <niuwanli@cysoftware.com.cn>
Date: Wed, 24 Jan 2024 17:14:47 +0800
Subject: [PATCH] Fix the FreeGC call funcs not checked
---
dix/gc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dix/gc.c b/dix/gc.c
index 4ccbd3b..80b375b 100644
--- a/dix/gc.c
+++ b/dix/gc.c
@@ -770,14 +770,16 @@ FreeGC(void *value, XID gid)
GCPtr pGC = (GCPtr) value;
CloseFont(pGC->font, (Font) 0);
- (*pGC->funcs->DestroyClip) (pGC);
+ if (pGC->funcs)
+ (*pGC->funcs->DestroyClip) (pGC);
if (!pGC->tileIsPixel)
(*pGC->pScreen->DestroyPixmap) (pGC->tile.pixmap);
if (pGC->stipple)
(*pGC->pScreen->DestroyPixmap) (pGC->stipple);
- (*pGC->funcs->DestroyGC) (pGC);
+ if (pGC->funcs)
+ (*pGC->funcs->DestroyGC) (pGC);
if (pGC->dash != DefaultDash)
free(pGC->dash);
dixFreeObjectWithPrivates(pGC, PRIVATE_GC);
--
2.33.0

View File

@ -16,7 +16,7 @@
Name: xorg-x11-server
Version: 1.20.11
Release: 26
Release: 27
Summary: X.Org X11 X server
License: MIT and GPLv2
URL: https://www.x.org
@ -118,6 +118,7 @@ Patch6032: backport-CVE-2023-6816.patch
Patch6033: backport-0001-CVE-2024-0229.patch
Patch6034: backport-0002-CVE-2024-0229.patch
Patch6035: backport-0003-CVE-2024-0229.patch
Patch6036: fix-segfault-if-CreateGC-failed-in-XaceHook.patch
BuildRequires: audit-libs-devel autoconf automake bison dbus-devel flex git gcc
BuildRequires: systemtap-sdt-devel libtool pkgconfig
@ -459,6 +460,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete
%{_mandir}/man*/*
%changelog
* Mon Feb 5 2024 niuwanli <niuwanli@cysoftware.com.cn> - 1.20.11-27
- fix segfault if CreateGC failed in XaceHook
* Mon Jan 29 2024 yangchenguang <yangchenguang@kylinsec.com.cn> - 1.20.11-26
- Modify sw_64 patch to use all arch