[PATCH] libXinerama: Set number to 0 on error.

Adam Jackson ajax at nwnk.net
Mon Jan 23 16:52:13 UTC 2017


On Sun, 2017-01-22 at 15:18 +0100, Tobias Stoeckmann wrote:

> @@ -286,6 +286,7 @@ XineramaQueryScreens(
>      if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
>  	UnlockDisplay (dpy);
>  	SyncHandle ();
> +	*number = 0;

Not that any caller has likely made this mistake, but you want an if
(number) before this, otherwise you turn a protocol error into a
segfault.

- ajax


More information about the xorg-devel mailing list