summaryrefslogtreecommitdiff
path: root/gdhcp/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdhcp/common.c')
-rw-r--r--gdhcp/common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdhcp/common.c b/gdhcp/common.c
index e8676f88..0c433ddc 100644
--- a/gdhcp/common.c
+++ b/gdhcp/common.c
@@ -172,8 +172,8 @@ uint8_t *dhcpv6_get_option(struct dhcpv6_packet *packet, uint16_t pkt_len,
if (opt_code == code) {
if (option_len != NULL)
*option_len = opt_len;
- if (rem == 0)
- found = NULL;
+ if (rem < 0)
+ goto bad_packet;
else
found = optionptr + 2 + 2;
count++;