From 128a03f88d85b4a7f3a4d02cacffd41b67725ba9 Mon Sep 17 00:00:00 2001 From: otto Date: Tue, 20 Feb 2018 16:22:19 +0000 Subject: [PATCH] make sure we've read the lenght bytes before checking the length ok benno@ --- sbin/slaacd/frontend.c | 4 ++-- 1 file 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 @@ -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; } -- 2.20.1