代码拉取完成,页面将自动刷新
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。