summaryrefslogtreecommitdiff
path: root/sbin/slaacd/frontend.c
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2018-02-20 16:22:20 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2018-02-20 16:22:20 +0000
commit146153733b474c6c9568af2464db72fd56b8006d (patch)
tree853d80b54c6cebbf4f4c755033e1c8eec6aa58d1 /sbin/slaacd/frontend.c
parent270ded58675504a553fcb4c1df23b2356d220a04 (diff)
make sure we've read the lenght bytes before checking the length
ok benno@
Diffstat (limited to 'sbin/slaacd/frontend.c')
-rw-r--r--sbin/slaacd/frontend.c4
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;
}