Minor bug in xcb_connect

0 views
Skip to first unread message

cho...@jtan.com

unread,
Feb 1, 2023, 3:58:11 AM2/1/23
to bu...@openbsd.org, xorg-...@lists.x.org
If the function implementing xcb_connect is called directly with a
custom xcb_auth_info_t then checking that the screen in $DISPLAY
is valid is skipped.

Matthew

Index: xcb_util.c
===================================================================
RCS file: /src/datum/openbsd/cvs/xenocara/dist/libxcb/src/xcb_util.c,v
retrieving revision 1.13
diff -u -p -r1.13 xcb_util.c
--- xcb_util.c 17 Jul 2022 08:31:10 -0000 1.13
+++ xcb_util.c 31 Jan 2023 22:20:24 -0000
@@ -528,10 +528,8 @@ xcb_connection_t *xcb_connect_to_display

if(auth) {
c = xcb_connect_to_fd(fd, auth);
- goto out;
}
-
- if(_xcb_get_auth_info(fd, &ourauth, display))
+ else if(_xcb_get_auth_info(fd, &ourauth, display))
{
c = xcb_connect_to_fd(fd, &ourauth);
free(ourauth.name);

Matthieu Herrb

unread,
Feb 1, 2023, 5:17:02 AM2/1/23
to cho...@jtan.com, xorg-...@lists.x.org, bu...@openbsd.org
On Tue, Jan 31, 2023 at 10:31:34PM +0000, cho...@jtan.com wrote:
> If the function implementing xcb_connect is called directly with a
> custom xcb_auth_info_t then checking that the screen in $DISPLAY
> is valid is skipped.
>
> Matthew

Hi,

Thank you for this patch. Can you also file a Merge Request to
upstream libxcb project at gitlab.freedesktop.org so that this can get
reviewed by libxcb developpers ?

https://gitlab.freedesktop.org/xorg/lib/libxcb/-/merge_requests

Regards,
>
> Index: xcb_util.c
> ===================================================================
> RCS file: /src/datum/openbsd/cvs/xenocara/dist/libxcb/src/xcb_util.c,v
> retrieving revision 1.13
> diff -u -p -r1.13 xcb_util.c
> --- xcb_util.c 17 Jul 2022 08:31:10 -0000 1.13
> +++ xcb_util.c 31 Jan 2023 22:20:24 -0000
> @@ -528,10 +528,8 @@ xcb_connection_t *xcb_connect_to_display
>
> if(auth) {
> c = xcb_connect_to_fd(fd, auth);
> - goto out;
> }
> -
> - if(_xcb_get_auth_info(fd, &ourauth, display))
> + else if(_xcb_get_auth_info(fd, &ourauth, display))
> {
> c = xcb_connect_to_fd(fd, &ourauth);
> free(ourauth.name);
>

--
Matthieu Herrb

cho...@jtan.com

unread,
Feb 27, 2023, 5:15:07 AM2/27/23
to Matthieu Herrb, xorg-...@lists.x.org, cho...@jtan.com, bu...@openbsd.org
Matthieu Herrb writes:
> On Tue, Jan 31, 2023 at 10:31:34PM +0000, cho...@jtan.com wrote:
> > If the function implementing xcb_connect is called directly with a
> > custom xcb_auth_info_t then checking that the screen in $DISPLAY
> > is valid is skipped.
> >
> > Matthew
>
> Hi,
>
> Thank you for this patch. Can you also file a Merge Request to
> upstream libxcb project at gitlab.freedesktop.org so that this can get
> reviewed by libxcb developpers ?

No.

You have a patch.

You can apply it and fix your bug, or you can not.

It's not my problem any more.

Matthew

Reply all
Reply to author
Forward
0 new messages