blob: acc19ca4364f4baba779a88f759700c8b7814725 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
$NetBSD: patch-ad,v 1.1 2005/05/28 14:15:23 adrianp Exp $
--- print-isoclns.c.orig 2005-05-06 09:11:15.000000000 +0100
+++ print-isoclns.c
@@ -1506,6 +1506,9 @@ static int isis_print (const u_int8_t *p
tlv_type,
tlv_len);
+ if (tlv_len == 0) /* something is malformed */
+ break;
+
/* now check if we have a decoder otherwise do a hexdump at the end*/
switch (tlv_type) {
case TLV_AREA_ADDR:
@@ -1536,7 +1539,7 @@ static int isis_print (const u_int8_t *p
break;
case TLV_ISNEIGH_VARLEN:
- if (!TTEST2(*tptr, 1))
+ if (!TTEST2(*tptr, 1) || tmp < 3) /* min. TLV length */
goto trunctlv;
lan_alen = *tptr++; /* LAN adress length */
tmp --;
|