chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
sd-dhcp-client: fix memory corruption
[elogind.git]
/
src
/
libsystemd
/
sd-dhcp-client.c
diff --git
a/src/libsystemd/sd-dhcp-client.c
b/src/libsystemd/sd-dhcp-client.c
index edfcb54a4c7b4762d219c63934eae8b661c631d5..1df89dc65111d2ece72766bb9e2cce203b8aef96 100644
(file)
--- 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;