On Wed, 2003-12-24 at 17:04, MH wrote:
> Sorry,
>
> My quotes in perl got messed up:
>
> perl -e 'print "\x80\x02"."\x00"x6' | nc -u 10.1.1.1 1701
>
> and
>
> perl -e 'print "\x80\x02"."\x00"x6 ."\x01"' | nc -u 10.1.1.1 1701
this patch should fix this bug.. try it on cvs version
--
mydecay
S.P.I.N.E. Group - http://www.spine-group.org
Key Fingerprint: 667A 4E73 EA53 66AC E2AB D0CA 2908 1484 1F26 4C40
GnuPG Key: http://www.spine-group.org/keys/mydecay.asc
--- print-l2tp.c.old 2003-12-24 19:35:08.000000000 +0100
+++ print-l2tp.c 2003-12-25 11:40:08.924099880 +0100
@@ -492,9 +492,11 @@
/* Vendor Specific Attribute */
printf("VENDOR%04x:", EXTRACT_16BITS(ptr)); ptr++;
printf("ATTR%04x", EXTRACT_16BITS(ptr)); ptr++;
- printf("(");
- print_octets((u_char *)ptr, len-6);
- printf(")");
+ if (len > 6) {
+ printf("(");
+ print_octets((u_char *)ptr, len-6);
+ printf(")");
+ }
} else {
/* IETF-defined Attributes */
ptr++;
@@ -594,7 +596,8 @@
printf(")");
}
- l2tp_avp_print(dat+len, length-len);
+ if (length >= len && len > 0)
+ l2tp_avp_print(dat+len, length-len);
return;
trunc: