From 12e8d0d01dd72ce98e7683ddb1bde181b7ed246f Mon Sep 17 00:00:00 2001 From: Christian Weisgerber Date: Tue, 18 Mar 2008 07:30:05 +0100 Subject: [PATCH] ConnDis: properly cast 'addr' before accessing it as a byte array. If you use XDM-AUTHORIZATION-1 authorization keys for remote X11 clients over IPv6, the clients are liable to segfaults. --- src/ConnDis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ConnDis.c b/src/ConnDis.c index f4a4dc86..03235b9a 100644 --- a/src/ConnDis.c +++ b/src/ConnDis.c @@ -1143,7 +1143,7 @@ GetAuthorization( /* In the case of v4 mapped addresses send the v4 part of the address - addr is already in network byte order */ - if (memcmp(addr+8, ipv4mappedprefix, 12) == 0) { + if (memcmp((char*)addr+8, ipv4mappedprefix, 12) == 0) { for (i = 20 ; i < 24; i++) xdmcp_data[j++] = ((char *)addr)[i];