sd-dhcp-server: clear buffer before receive

I do not think this is necessary, but all other places in
libsystemd-network we clear buffer before receive. Without this,
Coverity warns about use-of-uninitialized-values.
Let's silence Coverity.

Closes CID#1469721.
This commit is contained in:
Yu Watanabe
2024-06-12 00:48:56 +09:00
committed by Luca Boccassi
parent 1ea7bda77f
commit 40f9fa0af4

View File

@@ -1252,7 +1252,7 @@ static int server_receive_message(sd_event_source *s, int fd,
/* Preallocate the additional size for DHCP Relay Agent Information Option if needed */
buflen += relay_agent_information_length(server->agent_circuit_id, server->agent_remote_id) + 2;
message = malloc(buflen);
message = malloc0(buflen);
if (!message)
return -ENOMEM;