Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F171664089
D59555.id186316.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
978 B
Referenced Files
None
Subscribers
None
D59555.id186316.diff
View Options
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c
--- a/sbin/ping/ping.c
+++ b/sbin/ping/ping.c
@@ -1119,6 +1119,7 @@
struct icmp oicmp;
const u_char *oicmp_raw;
+ bzero(&icp, sizeof(icp));
/*
* Get size of IP header of the received packet.
* The header length is contained in the lower four bits of the first
@@ -1158,6 +1159,20 @@
if (icp.icmp_type == icmp_type_rsp) {
if (icp.icmp_id != ident)
return; /* 'Twas not our ECHO */
+ if (icmp_type_rsp == ICMP_MASKREPLY &&
+ cc < (ssize_t)(ICMP_MINLEN + MASK_LEN)) {
+ if (options & F_VERBOSE)
+ warnx("truncated mask reply (%zd bytes) from %s",
+ cc, inet_ntoa(from->sin_addr));
+ return;
+ }
+ if (icmp_type_rsp == ICMP_TSTAMPREPLY &&
+ cc < (ssize_t)(ICMP_MINLEN + TS_LEN)) {
+ if (options & F_VERBOSE)
+ warnx("truncated timestamp reply (%zd bytes) from %s",
+ cc, inet_ntoa(from->sin_addr));
+ return;
+ }
++nreceived;
triptime = 0.0;
if (timing) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Sep 13, 12:55 PM (7 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38680232
Default Alt Text
D59555.id186316.diff (978 B)
Attached To
Mode
D59555: ping: do a better job checking what we receive from the net
Attached
Detach File
Event Timeline
Log In to Comment