diff options
Diffstat (limited to 'nx-X11/programs/Xserver/os/access.c')
-rw-r--r-- | nx-X11/programs/Xserver/os/access.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/nx-X11/programs/Xserver/os/access.c b/nx-X11/programs/Xserver/os/access.c index db1b9b2c8..532e32f68 100644 --- a/nx-X11/programs/Xserver/os/access.c +++ b/nx-X11/programs/Xserver/os/access.c @@ -64,6 +64,9 @@ SOFTWARE. #include <stdio.h> #include <stdlib.h> +#define XSERV_t +#define TRANS_SERVER +#define TRANS_REOPEN #include <nx-X11/Xtrans/Xtrans.h> #include <nx-X11/Xauth.h> #include <nx-X11/X.h> @@ -1168,7 +1171,7 @@ ResetHosts (char *display) struct dn_naddr dnaddr, *dnaddrp, *dnet_addr(); #endif int family = 0; - void *addr; + void *addr = NULL; int len; siTypesInitialize(); @@ -1306,8 +1309,8 @@ ResetHosts (char *display) for (a = addresses ; a != NULL ; a = a->ai_next) { len = a->ai_addrlen; f = ConvertAddr(a->ai_addr,&len,(void **)&addr); - if ( (family == f) || - ((family == FamilyWild) && (f != -1)) ) { + if (addr && ((family == f) || + ((family == FamilyWild) && (f != -1)))) { NewHost(f, addr, len, FALSE); } } @@ -1696,7 +1699,7 @@ GetHosts ( for (host = validhosts; host; host = host->next) { len = host->len; - if ((ptr + sizeof(xHostEntry) + len) > (data + n)) + if ((ptr + sizeof(xHostEntry) + len) > ((unsigned char *) *data + n)) break; ((xHostEntry *)ptr)->family = host->family; ((xHostEntry *)ptr)->length = len; @@ -1775,7 +1778,7 @@ InvalidHost ( ClientPtr client) { int family; - void *addr; + void *addr = NULL; register HOST *selfhost, *host; if (!AccessEnabled) /* just let them in */ @@ -1810,7 +1813,7 @@ InvalidHost ( return (0); } } else { - if (addrEqual (family, addr, len, host)) + if (addr && addrEqual (family, addr, len, host)) return (0); } @@ -2082,7 +2085,7 @@ siHostnameAddrMatch(int family, void * addr, int len, struct addrinfo *addresses; struct addrinfo *a; int f, hostaddrlen; - void * hostaddr; + void * hostaddr = NULL; if (siAddrLen >= sizeof(hostname)) return FALSE; @@ -2094,7 +2097,7 @@ siHostnameAddrMatch(int family, void * addr, int len, for (a = addresses ; a != NULL ; a = a->ai_next) { hostaddrlen = a->ai_addrlen; f = ConvertAddr(a->ai_addr,&hostaddrlen,&hostaddr); - if ((f == family) && (len == hostaddrlen) && + if ((f == family) && (len == hostaddrlen) && hostaddr && (acmp (addr, hostaddr, len) == 0) ) { res = TRUE; break; |