Skip to content

Commit

Permalink
[TIPC]: Ignore message padding when receiving stream data
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Allan Stephens authored and David S. Miller committed Apr 15, 2008
1 parent a198d3a commit 7a8036c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/tipc/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7a8036c

Please sign in to comment.