summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-12-09 09:31:00 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2014-12-09 11:30:52 -0800
commit1559a94395258fd73e369f1a2c98a44bfe21a486 (patch)
tree732585d6c3495db76d536335bade2cc7ec222e4d /os
parent9802a0162f738de03585ca3f3b8a8266494f7d45 (diff)
dix: GetHosts bounds check using wrong pointer value [CVE-2014-8092 pt. 6]
GetHosts saves the pointer to allocated memory in *data, and then wants to bounds-check writes to that region, but was mistakenly using a bare 'data' instead of '*data'. Also, data is declared as void **, so we need a cast to turn it into a byte pointer so we can actually do pointer comparisons. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'os')
-rw-r--r--os/access.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/os/access.c b/os/access.c
index f393c8d54..28f2d3213 100644
--- a/os/access.c
+++ b/os/access.c
@@ -1308,7 +1308,7 @@ GetHosts(void **data, int *pnHosts, int *pLen, BOOL * pEnabled)
}
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;