mirror of
https://github.com/torvalds/linux.git
synced 2024-11-12 15:11:50 +00:00
[NET]: Do not dereference iov if length is zero
When msg_iovlen is zero we shouldn't try to dereference msg_iov. Right now the only thing that tries to do so is skb_copy_and_csum_datagram_iovec. Since the total length should also be zero if msg_iovlen is zero, it's sufficient to check the total length there and simply return if it's zero. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2fbe43f6f6
commit
ef8aef55ce
@ -450,6 +450,9 @@ int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb,
|
||||
__wsum csum;
|
||||
int chunk = skb->len - hlen;
|
||||
|
||||
if (!chunk)
|
||||
return 0;
|
||||
|
||||
/* Skip filled elements.
|
||||
* Pretty silly, look at memcpy_toiovec, though 8)
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user