summaryrefslogtreecommitdiff
path: root/src/libsystemd-network
diff options
context:
space:
mode:
authorsadag <sadasg@gmail.com>2016-05-20 04:26:27 -0700
committerEvgeny Vereshchagin <evvers@ya.ru>2016-05-20 14:26:27 +0300
commitad5ae47a0d159ea473c9730d7e0298a3e5d31cf6 (patch)
treefd30a81aed610de38bc2364d1345d96ba2d3f456 /src/libsystemd-network
parent35b132e8ad3c50614605e00cf8ff20988094d21c (diff)
sd-dhcp-client: fix busy loop reading zero sized DHCP UDP packets. (#3299)
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r--src/libsystemd-network/sd-dhcp-client.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c
index 3846cf7476..123169832c 100644
--- a/src/libsystemd-network/sd-dhcp-client.c
+++ b/src/libsystemd-network/sd-dhcp-client.c
@@ -1636,6 +1636,9 @@ static int client_receive_message_udp(
if (buflen < 0)
return buflen;
+ if (buflen == 0)
+ buflen = 1;
+
message = malloc0(buflen);
if (!message)
return -ENOMEM;