mirror of
https://github.com/torvalds/linux.git
synced 2024-12-29 06:12:08 +00:00
tcp: fix a size_t < 0 comparison in tcp_read_sock
<used> should be of type int (not size_t) since recv_actor can return negative values and it is also used in a < 0 comparison. Signed-off-by: Octavian Purdila <opurdila@ixiacom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
81b23b4a7a
commit
374e7b5949
@ -1209,7 +1209,8 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
|
||||
return -ENOTCONN;
|
||||
while ((skb = tcp_recv_skb(sk, seq, &offset)) != NULL) {
|
||||
if (offset < skb->len) {
|
||||
size_t used, len;
|
||||
int used;
|
||||
size_t len;
|
||||
|
||||
len = skb->len - offset;
|
||||
/* Stop reading if we hit a patch of urgent data */
|
||||
|
Loading…
Reference in New Issue
Block a user