From: fenner Date: Mon, 23 Jul 2001 22:27:30 +0000 (+0000) Subject: Pass the length of the authentication data to print_fn, instead of X-Git-Tag: tcpdump-3.7.1~121 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/4dba2d1283529c066192e69a2c365b399745fb29 Pass the length of the authentication data to print_fn, instead of an arbitrary value taken from the packet (which can trivially become negative, perhaps enabling buffer overruns). --- diff --git a/print-vrrp.c b/print-vrrp.c index caef77e0..2fd3fef5 100644 --- a/print-vrrp.c +++ b/print-vrrp.c @@ -25,7 +25,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-vrrp.c,v 1.4 2001-07-20 03:16:23 guy Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/print-vrrp.c,v 1.5 2001-07-23 22:27:30 fenner Exp $"; #endif #ifdef HAVE_CONFIG_H @@ -129,7 +129,7 @@ vrrp_print(register const u_char *bp, register u_int len, int ttl) if (auth_type == VRRP_AUTH_SIMPLE) { /* simple text password */ TCHECK(bp[7]); printf(" auth \""); - fn_printn(bp, bp[7] - bp[0] + 1, NULL); + fn_printn(bp, 8, NULL); printf("\""); } }