[Xcb-commit] xcb

Ian Osgood iano at kemper.freedesktop.org
Wed Mar 8 21:57:44 PST 2006


 xcb/src/xcb_auth.c |    2 ++
 1 files changed, 2 insertions(+)

New commits:
diff-tree 654cbcb859c17f59a268b67c0da73d1b4cd125a8 (from 06683c10caa826b7397a4d9e5c2a2c0d1ee64870)
Author: Ian Osgood <iosgood at Titania.local>
Date:   Wed Mar 8 21:56:57 2006 -0800

    Bugfix: null-terminate the path in sockaddr_un before using it.
    This may fix itermittant connect failures.

diff --git a/xcb/src/xcb_auth.c b/xcb/src/xcb_auth.c
index 9f2cb5a..fb1d0d3 100644
--- a/xcb/src/xcb_auth.c
+++ b/xcb/src/xcb_auth.c
@@ -168,7 +168,9 @@ static Xauth *get_authptr(struct sockadd
     case AF_UNIX:
 	/*block*/ { 
 	    struct sockaddr_un *su = (struct sockaddr_un *) sockname;
+	    char *sockbuf = (char *) sockname;
 	    assert(sizeof(*su) >= socknamelen);
+	    sockbuf[socknamelen] = 0;	/* null-terminate path */
 	    display = strrchr(su->sun_path, 'X');
 	    if (display == 0)
 		return 0;   /* sockname is mangled somehow */


More information about the xcb-commit mailing list