]> code.delx.au - pulseaudio/commitdiff
xcb: Ensure the XCB connection is valid before using it.
authorColin Guthrie <cguthrie@mandriva.org>
Sat, 18 Sep 2010 09:35:38 +0000 (10:35 +0100)
committerColin Guthrie <cguthrie@mandriva.org>
Sat, 18 Sep 2010 11:05:19 +0000 (12:05 +0100)
src/pulse/client-conf-x11.c
src/utils/pax11publish.c

index 565f997d99f7c99239e2a6d864ae4081657522c7..0348a2fd41e80d43fcce1105436accc44a4cd8a5 100644 (file)
@@ -55,6 +55,11 @@ int pa_client_conf_from_x11(pa_client_conf *c, const char *dname) {
         goto finish;
     }
 
+    if (xcb_connection_has_error(xcb)) {
+        pa_log(_("xcb_connection_has_error() returned true"));
+        goto finish;
+    }
+
     if (pa_x11_get_prop(xcb, "PULSE_SERVER", t, sizeof(t))) {
         pa_bool_t disable_autospawn = TRUE;
 
index 111bee2392e23b0da625f3a7fd4f76c79659e124..62b798c5a69ecd32e5d15f019d6919c348396e4f 100644 (file)
@@ -100,6 +100,11 @@ int main(int argc, char *argv[]) {
         goto finish;
     }
 
+    if (xcb_connection_has_error(xcb)) {
+        pa_log(_("xcb_connection_has_error() returned true"));
+        goto finish;
+    }
+
     switch (mode) {
         case DUMP: {
             char t[1024];