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 <[email protected]> --- 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 @@ -109,5 +109,5 @@ 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; -- 2.1.4
