summaryrefslogtreecommitdiff
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2018-05-10 01:25:18 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2018-05-10 01:25:18 -0700
commit6e5dae3ae1af25ac48b005ccfb2cf7e033d312ce (patch)
treeae877abfc5e691423dd5dbafab2a2eda81760e58 /net/ipv4/tcp_input.c
parentd7521d9bb9408dd4225b9838e23a80ecc41f80fa (diff)
parent028ce831e8f14cc94f14929f1a91d198ea2d9b93 (diff)
Merge "Merge android-4.4.131 (d5d6526) into msm-4.4"
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r--net/ipv4/tcp_input.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index da83648f95f8..b1cfce7f8e85 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3870,11 +3870,8 @@ const u8 *tcp_parse_md5sig_option(const struct tcphdr *th)
int length = (th->doff << 2) - sizeof(*th);
const u8 *ptr = (const u8 *)(th + 1);
- /* If the TCP option is too short, we can short cut */
- if (length < TCPOLEN_MD5SIG)
- return NULL;
-
- while (length > 0) {
+ /* If not enough data remaining, we can short cut */
+ while (length >= TCPOLEN_MD5SIG) {
int opcode = *ptr++;
int opsize;