summaryrefslogtreecommitdiff
path: root/usr.sbin/switchctl
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2018-10-15 11:30:38 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2018-10-15 11:30:38 +0000
commitfc1523575892bb86ae428d3b0b8a0ea4d0778bb5 (patch)
tree9c7652ce736b95b79b08f6470d9e278ee0433503 /usr.sbin/switchctl
parent9abbbedf455979d7fa05fd36b2db979115addaca (diff)
struct sockaddr_storage is guaranteed to be large enough, no need to check
the size. OK kn, deraadt
Diffstat (limited to 'usr.sbin/switchctl')
-rw-r--r--usr.sbin/switchctl/parser.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/usr.sbin/switchctl/parser.c b/usr.sbin/switchctl/parser.c
index adb42f33ce9..02870e560bd 100644
--- a/usr.sbin/switchctl/parser.c
+++ b/usr.sbin/switchctl/parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.c,v 1.8 2017/08/01 13:11:11 deraadt Exp $ */
+/* $OpenBSD: parser.c,v 1.9 2018/10/15 11:30:37 florian Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -273,10 +273,6 @@ parse_addr(const char *word, struct sockaddr_storage *ss)
hints.ai_family = PF_UNSPEC;
hints.ai_flags = AI_NUMERICHOST;
if (getaddrinfo(word, "0", &hints, &ai) == 0) {
- if (ai->ai_addrlen > sizeof(*ss)) {
- warnx("invalid address length");
- return (-1);
- }
memcpy(ss, ai->ai_addr, ai->ai_addrlen);
ss->ss_len = ai->ai_addrlen;
freeaddrinfo(ai);
@@ -290,10 +286,6 @@ parse_addr(const char *word, struct sockaddr_storage *ss)
hints.ai_flags = AI_ADDRCONFIG;
if (getaddrinfo(word, "0", &hints, &ai) == 0) {
/* Pick first name only */
- if (ai->ai_addrlen > sizeof(*ss)) {
- warnx("invalid address length");
- return (-1);
- }
memcpy(ss, ai->ai_addr, ai->ai_addrlen);
ss->ss_len = ai->ai_addrlen;
freeaddrinfo(ai);