diff options
author | 2018-02-20 16:22:19 +0000 | |
---|---|---|
committer | 2018-02-20 16:22:19 +0000 | |
commit | 128a03f88d85b4a7f3a4d02cacffd41b67725ba9 (patch) | |
tree | 9e215a0c08754b363989136700118bdd0b777f98 | |
parent | Move getvnetflowid() out of #ifndef SMALL to unbreak 'make release'. (diff) | |
download | wireguard-openbsd-128a03f88d85b4a7f3a4d02cacffd41b67725ba9.tar.xz wireguard-openbsd-128a03f88d85b4a7f3a4d02cacffd41b67725ba9.zip |
make sure we've read the lenght bytes before checking the length
ok benno@
-rw-r--r-- | sbin/slaacd/frontend.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/slaacd/frontend.c b/sbin/slaacd/frontend.c index c2c6637740a..4e3cd16f50b 100644 --- a/sbin/slaacd/frontend.c +++ b/sbin/slaacd/frontend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frontend.c,v 1.12 2018/02/19 09:52:16 otto Exp $ */ +/* $OpenBSD: frontend.c,v 1.13 2018/02/20 16:22:19 otto Exp $ */ /* * Copyright (c) 2017 Florian Obser <florian@openbsd.org> @@ -652,7 +652,7 @@ route_receive(int fd, short events, void *arg) if (n == 0) fatal("routing socket closed"); - if (n < rtm->rtm_msglen) { + if (n < (ssize_t)sizeof(rtm->rtm_msglen) || n < rtm->rtm_msglen) { log_warnx("partial rtm of %zd in buffer", n); return; } |