ctdb-common: Return if packet size is zero
authorSwen Schillig <swen@vnet.ibm.com>
Mon, 8 Jan 2018 13:10:40 +0000 (14:10 +0100)
committerMartin Schwenke <martins@samba.org>
Tue, 30 Jan 2018 12:28:39 +0000 (13:28 +0100)
Prevent further processing of sock_queue_process
if the received packet size is zero.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/common/sock_io.c

index 3f7138f..8a0b985 100644 (file)
@@ -231,6 +231,7 @@ static void sock_queue_process(struct sock_queue *queue)
        if (pkt_size == 0) {
                D_ERR("Invalid packet of length 0\n");
                queue->callback(NULL, 0, queue->private_data);
+               return;
        }
 
        if ((queue->end - queue->begin) < pkt_size) {