From b087416f97a2662d290dde1cd68c3134317d0b1f Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Thu, 16 Jan 2014 01:40:23 +0100 Subject: [PATCH] sd-dhcp-client: fix memory corruption --- src/libsystemd/sd-dhcp-client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsystemd/sd-dhcp-client.c b/src/libsystemd/sd-dhcp-client.c index edfcb54a4..1df89dc65 100644 --- a/src/libsystemd/sd-dhcp-client.c +++ b/src/libsystemd/sd-dhcp-client.c @@ -783,7 +783,7 @@ static int client_parse_offer(uint8_t code, uint8_t len, const uint8_t *option, memcpy(&lease->dns[i]->s_addr, option + 4 * i, 4); } - lease->dns[i + 1] = NULL; + lease->dns[len / 4] = NULL; } break; -- 2.30.2