[PATCH] rootless: fix uninitialized private key assert in non-rootless modes on cygwin

Jeremy Huddleston jeremyhu at apple.com
Tue Aug 3 18:30:10 PDT 2010


Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>

On Aug 3, 2010, at 09:05, Jon TURNEY wrote:

> IsFramedWindow() is called from miPaintWindow() if the server has
> been built with ROOTLESS defined, irrespective of if RootlessInit()
> has ever been called, or not.
> 
> Add a check to IsFramedWindow() to check if rootlessWindowPrivateKey
> has been initialized (as a proxy for checking if the rootless extension
> has been initialized) so we don't go on to try to use that key,
> triggering an assert.
> 
> Does this bug expose what appears to be a difference in opinion about
> the rootless extension between XQuartz and XWin?  XQuartz always
> initializes the rootless extension, whereas XWin offers several mode
> of operation, and the rootless extension is only used for one of them?
> 
> If so, that probably means that the code under compile time guard for
> ROOTLESS should also be under a run-time guard.
> 
> Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
> ---
> miext/rootless/rootlessCommon.c |    3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/miext/rootless/rootlessCommon.c b/miext/rootless/rootlessCommon.c
> index 82fe0b9..f19c885 100644
> --- a/miext/rootless/rootlessCommon.c
> +++ b/miext/rootless/rootlessCommon.c
> @@ -92,6 +92,9 @@ IsFramedWindow(WindowPtr pWin)
> {
>     WindowPtr top;
> 
> +    if(!rootlessWindowPrivateKeyRec.initialized)
> +      return FALSE;
> +
>     if (!pWin->realized)
>         return FALSE;
>     top = TopLevelParent(pWin);
> -- 
> 1.7.1
> 



More information about the xorg-devel mailing list