/[pkg-src]/trunk/xorg-server/patches/xorg-server-1.17.1-os-access-fix-regression-in-server-interpreted-auth.patch |
Contents of /trunk/xorg-server/patches/xorg-server-1.17.1-os-access-fix-regression-in-server-interpreted-auth.patch
Parent Directory | Revision Log
Revision 2576 -
(show annotations)
(download)
Mon Jun 15 13:02:17 2015 UTC (9 years, 3 months ago) by niro
File size: 993 byte(s)
Mon Jun 15 13:02:17 2015 UTC (9 years, 3 months ago) by niro
File size: 993 byte(s)
-fixed garbage patches
1 | diff --git a/os/access.c b/os/access.c |
2 | index 28f2d32..fe6e831 100644 |
3 | --- a/os/access.c |
4 | +++ b/os/access.c |
5 | @@ -1390,14 +1390,23 @@ InvalidHost(register struct sockaddr *saddr, int len, ClientPtr client) |
6 | else |
7 | return 0; |
8 | } |
9 | + |
10 | + /* An empty address requires both a NULL addr *and* a zero length |
11 | + * as the address comparison functions call memcmp with both |
12 | + * parameters. Make sure they agree here |
13 | + */ |
14 | + if (addr == NULL) |
15 | + len = 0; |
16 | + if (len == 0) |
17 | + addr = NULL; |
18 | for (host = validhosts; host; host = host->next) { |
19 | if (host->family == FamilyServerInterpreted) { |
20 | - if (addr && siAddrMatch(family, addr, len, host, client)) { |
21 | + if (siAddrMatch(family, addr, len, host, client)) { |
22 | return 0; |
23 | } |
24 | } |
25 | else { |
26 | - if (addr && addrEqual(family, addr, len, host)) |
27 | + if (addrEqual(family, addr, len, host)) |
28 | return 0; |
29 | } |
30 |