Merge pull request #878 from poettering/network-dhcp-array-fix
network: make enough space for string
This commit is contained in:
commit
511d2ffc8c
|
@ -779,7 +779,7 @@ int sd_dhcp_lease_save(sd_dhcp_lease *lease, const char *lease_file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
LIST_FOREACH(options, option, lease->private_options) {
|
LIST_FOREACH(options, option, lease->private_options) {
|
||||||
char key[strlen("OPTION_000")];
|
char key[strlen("OPTION_000")+1];
|
||||||
snprintf(key, sizeof(key), "OPTION_%"PRIu8, option->tag);
|
snprintf(key, sizeof(key), "OPTION_%"PRIu8, option->tag);
|
||||||
r = serialize_dhcp_option(f, key, option->data, option->length);
|
r = serialize_dhcp_option(f, key, option->data, option->length);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
|
|
Loading…
Reference in New Issue