From 0f613007cd43545eda40825bd74ada3e6e5f36f6 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Wed, 5 Aug 2009 17:43:29 -0700 Subject: [PATCH] CheckWindowOptionalNeed: Ensure w->optional is set to avoid SEGFAULT If CheckWindowOptionalNeed is called consecutively (and the first removes optional), then we will SEGFAULT. This can happen in XQuartz because ReparentWindow will call pScreen->ReparentWindow which can DeleteProperty which will CheckWindowOptionalNeed... then ReparentWindow will call it again later indiscriminantly. (cherry picked from commit b608c864ccc59628bd33c033393121b61580460e) --- dix/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dix/window.c b/dix/window.c index 1a645f61f..9663578f7 100644 --- a/dix/window.c +++ b/dix/window.c @@ -3386,7 +3386,7 @@ CheckWindowOptionalNeed (WindowPtr w) WindowOptPtr optional; WindowOptPtr parentOptional; - if (!w->parent) + if (!w->parent || !w->optional) return; optional = w->optional; if (optional->dontPropagateMask != DontPropagateMasks[w->dontPropagate])