Commit 7eee358d authored by Darren Tucker's avatar Darren Tucker

- dtucker@cvs.openbsd.org 2014/01/19 11:21:51

     [addrmatch.c]
     Cast the sizeof to socklen_t so it'll work even if the supplied len is
     negative.  Suggested by and ok djm, ok deraadt.
parent b7e01c09
......@@ -16,6 +16,10 @@
- djm@cvs.openbsd.org 2014/01/19 04:48:08
[ssh_config.5]
fix inverted meaning of 'no' and 'yes' for CanonicalizeFallbackLocal
- dtucker@cvs.openbsd.org 2014/01/19 11:21:51
[addrmatch.c]
Cast the sizeof to socklen_t so it'll work even if the supplied len is
negative. Suggested by and ok djm, ok deraadt.
20140118
- (dtucker) [uidswap.c] Prevent unused variable warnings on Cygwin. Patch
......
/* $OpenBSD: addrmatch.c,v 1.8 2014/01/19 04:17:29 dtucker Exp $ */
/* $OpenBSD: addrmatch.c,v 1.9 2014/01/19 11:21:51 dtucker Exp $ */
/*
* 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)
switch (sa->sa_family) {
case AF_INET:
if ((size_t)slen < sizeof(*in4))
if (slen < (socklen_t)sizeof(*in4))
return -1;
xa->af = AF_INET;
memcpy(&xa->v4, &in4->sin_addr, sizeof(xa->v4));
break;
case AF_INET6:
if ((size_t)slen < sizeof(*in6))
if (slen < (socklen_t)sizeof(*in6))
return -1;
xa->af = AF_INET6;
memcpy(&xa->v6, &in6->sin6_addr, sizeof(xa->v6));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment