From a8ae53a714fde9b65bfd1bb6a41fccd88ea0164e Mon Sep 17 00:00:00 2001 From: Gary Lockyer Date: Wed, 24 Jun 2020 14:27:08 +1200 Subject: [PATCH] s4 nbt: fix busy loop on empty UDP packet An empty UDP packet put the nbt server into a busy loop that consuming 100% of a cpu. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14417 Signed-off-by: Gary Lockyer --- libcli/nbt/nbtsocket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcli/nbt/nbtsocket.c b/libcli/nbt/nbtsocket.c index f682b233fd1..23fbbac00ee 100644 --- a/libcli/nbt/nbtsocket.c +++ b/libcli/nbt/nbtsocket.c @@ -168,7 +168,7 @@ static void nbt_name_socket_recv(struct nbt_name_socket *nbtsock) } blob = data_blob_talloc(tmp_ctx, NULL, dsize); - if (blob.data == NULL) { + if (blob.data == NULL && dsize != 0) { talloc_free(tmp_ctx); return; } -- 2.17.1