mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 08:25:20 +09:00
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:
committed by
Luca Boccassi
parent
1ea7bda77f
commit
40f9fa0af4
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user