borrowed from fedora
fix for CAN-2005-1267

--- tcpdump-3.8.2/print-bgp.c.old	2005-05-31 11:58:00.000000000 +0200
+++ tcpdump-3.8.2/print-bgp.c	2005-05-31 12:01:01.000000000 +0200
@@ -1706,9 +1706,10 @@
 		while (dat + length > p) {
 			char buf[MAXHOSTNAMELEN + 100];
 			i = decode_prefix4(p, buf, sizeof(buf));
-			if (i == -1)
+			if (i == -1) {
 				printf("\n\t    (illegal prefix length)");
-			else if (i == -2)
+				break;
+			} else if (i == -2)
 				goto trunc;
 			else {
 				printf("\n\t    %s", buf);
