From 95b743d5b0e207ecbe92252757100641b5e13d35 Mon Sep 17 00:00:00 2001 From: yiwenchen Date: Wed, 14 Feb 2018 22:26:54 +0000 Subject: [PATCH] Fix boundary for test introduced in 3e3f1029c9ec6c63e430ff51063a6301d4b2262 This fixes breakage of DHCPv6 relay. (cherry picked from commit 499d8dde2b1a216eab9252ee500cc31b8c2b2974) --- src/rfc3315.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rfc3315.c b/src/rfc3315.c index 1e85c5c..42c7a0e 100644 --- a/src/rfc3315.c +++ b/src/rfc3315.c @@ -216,9 +216,9 @@ static int dhcp6_maybe_relay(struct state *state, void *inbuff, size_t sz, for (opt = opts; opt; opt = opt6_next(opt, end)) { - if (opt6_ptr(opt, 0) + opt6_len(opt) >= end) { + if (opt6_ptr(opt, 0) + opt6_len(opt) > end) return 0; - } + int o = new_opt6(opt6_type(opt)); if (opt6_type(opt) == OPTION6_RELAY_MSG) { -- 2.21.1