From 7a8036c2b93c8301afce8f75ac099c347bad569d Mon Sep 17 00:00:00 2001 From: Allan Stephens Date: Tue, 15 Apr 2008 00:15:15 -0700 Subject: [PATCH] [TIPC]: Ignore message padding when receiving stream data This patch ensures that padding bytes appearing at the end of an incoming TIPC message are not returned as valid stream data. Signed-off-by: Allan Stephens Signed-off-by: David S. Miller --- net/tipc/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/tipc/socket.c b/net/tipc/socket.c index c1a199c0fa..ead22e5eed 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -1027,7 +1027,7 @@ restart: if (!err) { buf_crs = (unsigned char *)(TIPC_SKB_CB(buf)->handle); - sz = skb_tail_pointer(buf) - buf_crs; + sz = (unsigned char *)msg + msg_size(msg) - buf_crs; needed = (buf_len - sz_copied); sz_to_copy = (sz <= needed) ? sz : needed; -- 2.39.5