X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/aadd1adef0a9576ecd676db6c96c86d76d545a4f..d796938ccc729228e1d8c41266e54c63d6fe75dc:/package/busybox/patches/450-truncated_ping_results.patch?ds=sidebyside diff --git a/package/busybox/patches/450-truncated_ping_results.patch b/package/busybox/patches/450-truncated_ping_results.patch index 30e86701a..34582c2ba 100644 --- a/package/busybox/patches/450-truncated_ping_results.patch +++ b/package/busybox/patches/450-truncated_ping_results.patch @@ -1,11 +1,13 @@ ---- busybox-1.4.1/networking/ping.c 2007-01-24 22:34:34.000000000 +0100 -+++ busybox-1.4.1.new/networking/ping.c 2007-02-28 20:35:59.000000000 +0100 +Index: busybox-1.4.2/networking/ping.c +=================================================================== +--- busybox-1.4.2.orig/networking/ping.c 2007-06-04 13:21:31.931122400 +0200 ++++ busybox-1.4.2/networking/ping.c 2007-06-04 13:21:36.518425024 +0200 @@ -70,7 +70,7 @@ struct sockaddr_in pingaddr; struct icmp *pkt; int pingsock, c; - char packet[DEFDATALEN + MAXIPLEN + MAXICMPLEN]; -+ char packet[datalen + MAXIPLEN + MAXICMPLEN]; ++ char packet[datalen + ICMP_MINLEN + MAXIPLEN + MAXICMPLEN]; pingsock = create_icmp_socket(); @@ -18,17 +20,6 @@ (struct sockaddr *) &pingaddr, sizeof(struct sockaddr_in)); if (c < 0) { -@@ -257,8 +257,8 @@ - - gettimeofday(&tv, NULL); - -- /* discard if too short */ -- if (sz < (datalen + ICMP_MINLEN)) -+ /* discard if too short / long */ -+ if (sz < (datalen + ICMP_MINLEN) || sz > (MAXICMPLEN)) - return; - - /* check IP header */ @@ -274,6 +274,10 @@ ++nreceived; tp = (struct timeval *) icmppkt->icmp_data;