Repository : ssh://git@open-mesh.org/alfred
On branch : master
commit 58a80ef1ec4db647dfcfe89b731c0af603570531 Author: Sven Eckelmann sven@narfation.org Date: Sun May 31 13:35:59 2015 +0200
alfred: First check only push_data header length
The length in the TLV header for push_data is without the TLV header itself. So the length check should instead only check for this size because the other size checks will be done later.
Signed-off-by: Sven Eckelmann sven@narfation.org Signed-off-by: Simon Wunderlich sw@simonwunderlich.de
58a80ef1ec4db647dfcfe89b731c0af603570531 unix_sock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/unix_sock.c b/unix_sock.c index 29c934e..570c62c 100644 --- a/unix_sock.c +++ b/unix_sock.c @@ -108,7 +108,7 @@ static int unix_sock_add_data(struct globals *globals,
len = ntohs(push->header.length);
- if (len < (int)(sizeof(*push) + sizeof(push->header))) + if (len < (int)(sizeof(*push) - sizeof(push->header))) goto err;
/* subtract rest of push header */