summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/test-dhcp-option.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-09-17 19:07:56 +0200
committerTom Gundersen <teg@jklm.no>2014-09-17 19:13:35 +0200
commit6f42877282a7237f3aa840403047b7cc18d7faa6 (patch)
tree45c60895c9aee7e9507f5b89f48eee40a00c7cc2 /src/libsystemd-network/test-dhcp-option.c
parentf414a269b378d526b8b26c5b52743360b43965ce (diff)
libsystemd-network: dhcp-test - assert that malloc0 succeeds
Otherwise we would get a nullptr dereference later on. Found by coverity. Fixes CID #1237655.
Diffstat (limited to 'src/libsystemd-network/test-dhcp-option.c')
-rw-r--r--src/libsystemd-network/test-dhcp-option.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libsystemd-network/test-dhcp-option.c b/src/libsystemd-network/test-dhcp-option.c
index 7a0fac8d33..63cdc7aa06 100644
--- a/src/libsystemd-network/test-dhcp-option.c
+++ b/src/libsystemd-network/test-dhcp-option.c
@@ -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);