diff options
author | 2014-01-19 04:17:29 +0000 | |
---|---|---|
committer | 2014-01-19 04:17:29 +0000 | |
commit | ced49c3f5d868dce499aec373aac54a4fdaa3f22 (patch) | |
tree | a48dc62e10d24e4d61403738fb4f7963fc0da6d4 /usr.bin/ssh/addrmatch.c | |
parent | Fix minor ident issue. OK benno@, pelikan@ (diff) | |
download | wireguard-openbsd-ced49c3f5d868dce499aec373aac54a4fdaa3f22.tar.xz wireguard-openbsd-ced49c3f5d868dce499aec373aac54a4fdaa3f22.zip |
Cast socklen_t when comparing to size_t and use socklen_t to iterate over
the ip options, both to prevent signed/unsigned comparison warnings.
Patch from vinschen at redhat via portable openssh, begrudging ok deraadt.
Diffstat (limited to 'usr.bin/ssh/addrmatch.c')
-rw-r--r-- | usr.bin/ssh/addrmatch.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/ssh/addrmatch.c b/usr.bin/ssh/addrmatch.c index b2c86b46e0d..fbd858c2d34 100644 --- a/usr.bin/ssh/addrmatch.c +++ b/usr.bin/ssh/addrmatch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: addrmatch.c,v 1.7 2013/05/17 00:13:13 djm Exp $ */ +/* $OpenBSD: addrmatch.c,v 1.8 2014/01/19 04:17:29 dtucker Exp $ */ /* * Copyright (c) 2004-2008 Damien Miller <djm@mindrot.org> @@ -86,13 +86,13 @@ addr_sa_to_xaddr(struct sockaddr *sa, socklen_t slen, struct xaddr *xa) switch (sa->sa_family) { case AF_INET: - if (slen < sizeof(*in4)) + if ((size_t)slen < sizeof(*in4)) return -1; xa->af = AF_INET; memcpy(&xa->v4, &in4->sin_addr, sizeof(xa->v4)); break; case AF_INET6: - if (slen < sizeof(*in6)) + if ((size_t)slen < sizeof(*in6)) return -1; xa->af = AF_INET6; memcpy(&xa->v6, &in6->sin6_addr, sizeof(xa->v6)); |