15 Star 1 Fork 46

src-openEuler/xorg-x11-server

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-0003-CVE-2023-5574.patch 1.39 KB
一键复制 编辑 原始数据 按行查看 历史
ultra_planet 提交于 2024-10-25 14:57 +08:00 . fix CVE-2023-5574
From ab2c58ba4719fc31c19c7829b06bdba8a88bd586 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue, 24 Oct 2023 12:09:36 +1000
Subject: [PATCH] dix: always initialize pScreen->CloseScreen
CloseScreen is wrapped by the various modules, many of which do not
check if they're the last ones unwrapping. This is fine if the order of
those modules never changes but when it does we might get a NULL-pointer
dereference by some naive code doing a
pScreen->CloseScreen = priv->CloseScreen;
free(priv);
return (*pScreen->CloseScreen)(pScreen);
To avoid this set it to a default function that just returns TRUE that's
guaranteed to be the last one.
---
dix/dispatch.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/dix/dispatch.c b/dix/dispatch.c
index eaac39b7c9..cd092fd409 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -3890,6 +3890,12 @@ static int indexForScanlinePad[65] = {
3 /* 64 bits per scanline pad unit */
};
+static Bool
+DefaultCloseScreen(ScreenPtr screen)
+{
+ return TRUE;
+}
+
/*
grow the array of screenRecs if necessary.
call the device-supplied initialization procedure
@@ -3949,6 +3955,9 @@ static int init_screen(ScreenPtr pScreen, int i, Bool gpu)
PixmapWidthPaddingInfo[depth].notPower2 = 0;
}
}
+
+ pScreen->CloseScreen = DefaultCloseScreen;
+
return 0;
}
--
GitLab
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/xorg-x11-server.git
git@gitee.com:src-openeuler/xorg-x11-server.git
src-openeuler
xorg-x11-server
xorg-x11-server
master

搜索帮助

371d5123 14472233 46e8bd33 14472233