1 Index: busybox-1.4.2/networking/ping.c
2 ===================================================================
3 --- busybox-1.4.2.orig/networking/ping.c 2007-06-04 13:21:31.931122400 +0200
4 +++ busybox-1.4.2/networking/ping.c 2007-06-04 13:21:36.518425024 +0200
6 struct sockaddr_in pingaddr;
9 - char packet[DEFDATALEN + MAXIPLEN + MAXICMPLEN];
10 + char packet[datalen + ICMP_MINLEN + MAXIPLEN + MAXICMPLEN];
12 pingsock = create_icmp_socket();
15 pkt->icmp_type = ICMP_ECHO;
16 pkt->icmp_cksum = in_cksum((unsigned short *) pkt, sizeof(packet));
18 - c = sendto(pingsock, packet, DEFDATALEN + ICMP_MINLEN, 0,
19 + c = sendto(pingsock, packet, datalen + ICMP_MINLEN, 0,
20 (struct sockaddr *) &pingaddr, sizeof(struct sockaddr_in));
25 tp = (struct timeval *) icmppkt->icmp_data;
27 + /* If packet is too short, results will be truncated */
28 + if (sz < (ICMP_MINLEN + sizeof(tv.tv_sec) + sizeof(tv.tv_usec)))
31 if ((tv.tv_usec -= tp->tv_usec) < 0) {
33 tv.tv_usec += 1000000;