projects
/
GitHub
/
LineageOS
/
android_kernel_samsung_universal7580.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
81b23b4
)
tcp: fix a size_t < 0 comparison in tcp_read_sock
author
Octavian Purdila
<opurdila@ixiacom.com>
Thu, 3 Jul 2008 10:31:21 +0000
(
03:31
-0700)
committer
David S. Miller
<davem@davemloft.net>
Thu, 3 Jul 2008 10:31:21 +0000
(
03:31
-0700)
<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>
net/ipv4/tcp.c
patch
|
blob
|
blame
|
history
diff --git
a/net/ipv4/tcp.c
b/net/ipv4/tcp.c
index de53024664e4bb5ee62be7342d1598366eb6713d..1d723de18686a9ff80bb82876fac7a1ee7fb013e 100644
(file)
--- a/
net/ipv4/tcp.c
+++ b/
net/ipv4/tcp.c
@@
-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 */