[commits] [alfred] master: alfred: Stop client when data header could not be read (6a2276c)

postmaster at open-mesh.org postmaster at open-mesh.org
Mon Sep 9 19:19:35 CEST 2013


Repository : ssh://git@open-mesh.org/alfred

On branch  : master

>---------------------------------------------------------------

commit 6a2276c084e78be16abc55b8c03420c9dac98ffa
Author: Sven Eckelmann <sven at open-mesh.com>
Date:   Mon Sep 9 17:46:04 2013 +0200

    alfred: Stop client when data header could not be read
    
    Signed-off-by: Sven Eckelmann <sven at open-mesh.com>
    Signed-off-by: Simon Wunderlich <simon at open-mesh.com>


>---------------------------------------------------------------

6a2276c084e78be16abc55b8c03420c9dac98ffa
 client.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/client.c b/client.c
index 3c1916c..2187ff2 100644
--- a/client.c
+++ b/client.c
@@ -81,6 +81,9 @@ int alfred_client_request_data(struct globals *globals)
 		ret = read(globals->unix_sock, buf + sizeof(*push),
 			   sizeof(*data));
 
+		if (ret < (ssize_t)sizeof(*data))
+			break;
+
 		data = push->data;
 		data_len = ntohs(data->header.length);
 



More information about the commits mailing list