From 225accd235a09413ca253e710d7d691a3475c523 Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Wed, 14 Aug 2019 21:52:50 +0100 Subject: [PATCH] Fix breakage of dhcp_lease_time utility. --- CHANGELOG | 4 ++++ contrib/lease-tools/dhcp_lease_time.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 8e83c82..666ed9a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -38,6 +38,10 @@ version 2.81 the DHCP server in subnets where the server (or relay) doesn't have an interface on the network in that subnet. Many thanks to kamp.de for sponsoring this feature. + + Fix broken contrib/lease_tools/dhcp_lease_time.c. A packet + validation check got borked in commit 2b38e382 and release 2.80. + Thanks to Tomasz Szajner for spotting this. version 2.80 diff --git a/contrib/lease-tools/dhcp_lease_time.c b/contrib/lease-tools/dhcp_lease_time.c index 697d627..91edbfa 100644 --- a/contrib/lease-tools/dhcp_lease_time.c +++ b/contrib/lease-tools/dhcp_lease_time.c @@ -83,7 +83,7 @@ static unsigned char *option_find1(unsigned char *p, unsigned char *end, int opt if (p >= end - 2) return NULL; /* malformed packet */ opt_len = option_len(p); - if (end - p >= (2 + opt_len)) + if (end - p < (2 + opt_len)) return NULL; /* malformed packet */ if (*p == opt && opt_len >= minsize) return p;