iputils/iputils-ss021109-ping_common.dif

17 lines
559 B
Plaintext

--- ping_common.c 2006-12-01 12:58:33.000000000 +0100
+++ ping_common.c 2006-12-01 12:59:59.000000000 +0100
@@ -187,6 +187,13 @@
fprintf(stderr, "ping: illegal negative packet size %d.\n", datalen);
exit(2);
}
+ if (datalen > 0xFFFF - 8 ) {
+ if (uid || datalen > 0xFFFF ) {
+ fprintf(stderr, "Error: packet size %d is too large. Maximim is %d\n", datalen, 0xFFFF - 8);
+ exit(2);
+ }
+ fprintf(stderr, "WARNING: packet size %d is too large. Maximim is %d\n", datalen, 0xFFFF - 8 );
+ }
break;
case 'v':
options |= F_VERBOSE;