瀏覽代碼

[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 <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Allan Stephens 17 年之前
父節點
當前提交
7a8036c2b9
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      net/tipc/socket.c

+ 1 - 1
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;