libsystemd-network: dhcp-test - assert that malloc0 succeeds
Otherwise we would get a nullptr dereference later on. Found by coverity. Fixes CID #1237655.
This commit is contained in:
parent
f414a269b3
commit
6f42877282
|
@ -115,6 +115,7 @@ static DHCPMessage *create_message(uint8_t *options, uint16_t optlen,
|
|||
size_t len = sizeof(DHCPMessage) + optlen;
|
||||
|
||||
message = malloc0(len);
|
||||
assert_se(message);
|
||||
|
||||
if (options && optlen)
|
||||
memcpy(&message->options, options, optlen);
|
||||
|
|
Loading…
Reference in a new issue