summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libsystemd/sd-dhcp-client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd/sd-dhcp-client.c b/src/libsystemd/sd-dhcp-client.c
index edfcb54a4c..1df89dc651 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;