From: Tom Gundersen Date: Thu, 16 Jan 2014 00:40:23 +0000 (+0100) Subject: sd-dhcp-client: fix memory corruption X-Git-Tag: v209~425 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=b087416f97a2662d290dde1cd68c3134317d0b1f sd-dhcp-client: fix memory corruption --- 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;