aboutsummaryrefslogtreecommitdiff
path: root/libxcb/src/xcb_util.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-08-31 15:18:29 +0200
committermarha <marha@users.sourceforge.net>2012-09-04 14:23:28 +0200
commitd7fc06ac528d54e0e1416cb8aa89b6fd072400a5 (patch)
tree74cccede044412bba5723a132f1385aa9259f04b /libxcb/src/xcb_util.c
parent9dec848b23cf905ded387820f2893425cc00d545 (diff)
downloadvcxsrv-d7fc06ac528d54e0e1416cb8aa89b6fd072400a5.tar.gz
vcxsrv-d7fc06ac528d54e0e1416cb8aa89b6fd072400a5.tar.bz2
vcxsrv-d7fc06ac528d54e0e1416cb8aa89b6fd072400a5.zip
randrproto xwininfo fontconfig libxcb mesa xkeyboard-config pixman xserver
git update 31 Aug 2012
Diffstat (limited to 'libxcb/src/xcb_util.c')
-rw-r--r--libxcb/src/xcb_util.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/libxcb/src/xcb_util.c b/libxcb/src/xcb_util.c
index 065fe1407..5cee9ca2d 100644
--- a/libxcb/src/xcb_util.c
+++ b/libxcb/src/xcb_util.c
@@ -25,6 +25,10 @@
/* Utility functions implementable using only public APIs. */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <assert.h>
#include <sys/types.h>
#include <limits.h>
@@ -51,7 +55,6 @@
#include "xcbext.h"
#include "xcbint.h"
-/* must be after "xcbint.h" to get autoconf #defines */
#if defined(HAVE_TSOL_LABEL_H) && defined(HAVE_IS_SYSTEM_LABELED)
# include <tsol/label.h>
# include <sys/stat.h>
@@ -493,6 +496,16 @@ xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *displayname,
else
c = xcb_connect_to_fd(fd, 0);
+ if(c->has_error)
+ goto out;
+
+ /* Make sure requested screen number is in bounds for this server */
+ if((screenp != NULL) && (*screenp >= (int) c->setup->roots_len)) {
+ xcb_disconnect(c);
+ c = _xcb_conn_ret_error(XCB_CONN_CLOSED_INVALID_SCREEN);
+ goto out;
+ }
+
out:
free(host);
free(protocol);