From b608c864ccc59628bd33c033393121b61580460e 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. --- dix/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dix/window.c b/dix/window.c index 9bbbed585..256d8666c 100644 --- a/dix/window.c +++ b/dix/window.c @@ -3534,7 +3534,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])