--- src/xcb_auth.c.orig 2008-01-22 18:35:14.000000000 +0200 +++ src/xcb_auth.c 2008-01-22 18:37:03.000000000 +0200 @@ -247,7 +247,12 @@ info->namelen = memdup(&info->name, authptr->name, authptr->name_length); if(info->namelen) - ret = compute_auth(info, authptr, sockname); + { + if (getsockname(fd, sockname, &socknamelen) == -1) + ret = 0; + else + ret = compute_auth(info, authptr, sockname); + } if(!ret) { free(info->name);