mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-29 10:01:25 +00:00
[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>
This commit is contained in:
parent
a198d3a200
commit
7a8036c2b9
1 changed files with 1 additions and 1 deletions
|
@ -1027,7 +1027,7 @@ restart:
|
||||||
|
|
||||||
if (!err) {
|
if (!err) {
|
||||||
buf_crs = (unsigned char *)(TIPC_SKB_CB(buf)->handle);
|
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);
|
needed = (buf_len - sz_copied);
|
||||||
sz_to_copy = (sz <= needed) ? sz : needed;
|
sz_to_copy = (sz <= needed) ? sz : needed;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue