aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/ping.c')
-rw-r--r--net/ipv4/ping.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index f6ee0d561aab..3dac3d4aa26f 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -659,6 +659,10 @@ int ping_common_sendmsg(int family, struct msghdr *msg, size_t len,
659 if (len > 0xFFFF) 659 if (len > 0xFFFF)
660 return -EMSGSIZE; 660 return -EMSGSIZE;
661 661
662 /* Must have at least a full ICMP header. */
663 if (len < icmph_len)
664 return -EINVAL;
665
662 /* 666 /*
663 * Check the flags. 667 * Check the flags.
664 */ 668 */