Repository : ssh://git@open-mesh.org/alfred
On branch : master
commit 6ea96243cd6918f8f8cecca5ba92c3fe9c7f6c7e Author: Sven Eckelmann sven@open-mesh.com Date: Tue Jan 8 18:31:23 2013 +0100
alfred: Fix client buffer check
The size of the buffer cannot be checked by using sizeof(*buf) because this is only the size of a single element of this buffer. Therefore the check for the size would always return false and the client would never print any data.
Signed-off-by: Sven Eckelmann sven@open-mesh.com
6ea96243cd6918f8f8cecca5ba92c3fe9c7f6c7e client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client.c b/client.c index 27a5ddb..700c96e 100644 --- a/client.c +++ b/client.c @@ -63,7 +63,7 @@ int alfred_client_request_data(struct globals *globals) data_len = ntohs(data->length);
/* would it fit? it should! */ - if (data_len > sizeof(*buf) - headlen) + if (data_len > sizeof(buf) - headlen) break;
/* read the data */