[PATCH libX11] XKB: fix XkbGetKeyboardByName with Xming server

Daniel Stone daniel at fooishbar.org
Thu Jan 21 01:40:48 PST 2016


On 21 January 2016 at 08:58, Olivier Fourdan <ofourdan at redhat.com> wrote:
> XkbGetKeyboardByName relies on flags to read the data from the server.
> If the X server sends us the wrong flags or if a subreply is smaller
> than it should be, XkbGetKeyboardByName will not read all the available
> data and leave data in the buffer, which will cause the next _XReply()
> to fail with:
> [xcb] Extra reply data still left in queue
> [xcb] This is most likely caused by a broken X extension library
> [xcb] Aborting, sorry about that.
> xcb_io.c:576: _XReply: Assertion `!xcb_xlib_extra_reply_data_left' failed.
> Aborted
> Check if there is some extra data left at the end of
> XkbGetKeyboardByName() and discard that data if any is found.

Thanks, that looks really good! (And I almost wonder if we shouldn't
cache data from the last reply - request/sequence number, etc - to
make that error a bit more friendly.)

> @@ -204,12 +215,16 @@ XkbGetKeyboardByName(Display *dpy,
>          if (status != Success)
>              goto BAILOUT;
>      }
> +    if (extraLen > 0)
> +       _discardExtraLen(dpy, extraLen);
>      UnlockDisplay(dpy);
>      SyncHandle();
>      return xkb;

This case seems like it shouldn't return success, but instead jump to
BAILOUT; if there's extra unconsumed data, either the server is
broken, or we've missed something.

With that fixed:
Reviewed-by: Daniel Stone <daniels at collabora.com>


More information about the xorg-devel mailing list