summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--addrmatch.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 990739468..22578ab21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,10 @@
16 - djm@cvs.openbsd.org 2014/01/19 04:48:08 16 - djm@cvs.openbsd.org 2014/01/19 04:48:08
17 [ssh_config.5] 17 [ssh_config.5]
18 fix inverted meaning of 'no' and 'yes' for CanonicalizeFallbackLocal 18 fix inverted meaning of 'no' and 'yes' for CanonicalizeFallbackLocal
19 - dtucker@cvs.openbsd.org 2014/01/19 11:21:51
20 [addrmatch.c]
21 Cast the sizeof to socklen_t so it'll work even if the supplied len is
22 negative. Suggested by and ok djm, ok deraadt.
19 23
2020140118 2420140118
21 - (dtucker) [uidswap.c] Prevent unused variable warnings on Cygwin. Patch 25 - (dtucker) [uidswap.c] Prevent unused variable warnings on Cygwin. Patch
diff --git a/addrmatch.c b/addrmatch.c
index 649de4139..c44314632 100644
--- a/addrmatch.c
+++ b/addrmatch.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: addrmatch.c,v 1.8 2014/01/19 04:17:29 dtucker Exp $ */ 1/* $OpenBSD: addrmatch.c,v 1.9 2014/01/19 11:21:51 dtucker Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2004-2008 Damien Miller <djm@mindrot.org> 4 * Copyright (c) 2004-2008 Damien Miller <djm@mindrot.org>
@@ -88,13 +88,13 @@ addr_sa_to_xaddr(struct sockaddr *sa, socklen_t slen, struct xaddr *xa)
88 88
89 switch (sa->sa_family) { 89 switch (sa->sa_family) {
90 case AF_INET: 90 case AF_INET:
91 if ((size_t)slen < sizeof(*in4)) 91 if (slen < (socklen_t)sizeof(*in4))
92 return -1; 92 return -1;
93 xa->af = AF_INET; 93 xa->af = AF_INET;
94 memcpy(&xa->v4, &in4->sin_addr, sizeof(xa->v4)); 94 memcpy(&xa->v4, &in4->sin_addr, sizeof(xa->v4));
95 break; 95 break;
96 case AF_INET6: 96 case AF_INET6:
97 if ((size_t)slen < sizeof(*in6)) 97 if (slen < (socklen_t)sizeof(*in6))
98 return -1; 98 return -1;
99 xa->af = AF_INET6; 99 xa->af = AF_INET6;
100 memcpy(&xa->v6, &in6->sin6_addr, sizeof(xa->v6)); 100 memcpy(&xa->v6, &in6->sin6_addr, sizeof(xa->v6));