提交 7a8036c2 编写于 作者: A Allan Stephens 提交者: David S. Miller

[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: NAllan Stephens <allan.stephens@windriver.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 a198d3a2
......@@ -1027,7 +1027,7 @@ static int recv_stream(struct kiocb *iocb, struct socket *sock,
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册