projects
/
profile
/
ivi
/
libxcb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
522a6e0
)
Bugfix: null-terminate the path in sockaddr_un before using it.
author
Ian Osgood
<iosgood@Titania.local>
Thu, 9 Mar 2006 05:56:57 +0000
(21:56 -0800)
committer
Ian Osgood
<iosgood@Titania.local>
Thu, 9 Mar 2006 05:56:57 +0000
(21:56 -0800)
This may fix itermittant connect failures.
src/xcb_auth.c
patch
|
blob
|
history
diff --git
a/src/xcb_auth.c
b/src/xcb_auth.c
index
9f2cb5a
..
fb1d0d3
100644
(file)
--- 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 */