summaryrefslogtreecommitdiff
path: root/src/xcb_auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xcb_auth.c')
-rw-r--r--src/xcb_auth.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/xcb_auth.c b/src/xcb_auth.c
index 9f2cb5a..fb1d0d3 100644
--- a/src/xcb_auth.c
+++ b/src/xcb_auth.c
@@ -168,7 +168,9 @@ static Xauth *get_authptr(struct sockaddr *sockname, unsigned int socknamelen)
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 */