From e2986fd5636dd96b7035d27d2dded0a0153872fa Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 22 Jan 2006 05:28:34 +0000 Subject: [PATCH] From Sam Leffler and Jason Evans: fix the allocation of the buffer for the list of link-layer types. --- pcap-bpf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pcap-bpf.c b/pcap-bpf.c index b6b85b2..649568f 100644 --- a/pcap-bpf.c +++ b/pcap-bpf.c @@ -20,7 +20,7 @@ */ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/libpcap/pcap-bpf.c,v 1.86.2.8 2005-07-10 10:55:31 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/libpcap/pcap-bpf.c,v 1.86.2.9 2006-01-22 05:28:34 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -746,7 +746,7 @@ pcap_open_live(const char *device, int snaplen, int promisc, int to_ms, u_int i; int is_ethernet; - bdl.bfl_list = (u_int *) malloc(sizeof(u_int) * bdl.bfl_len + 1); + bdl.bfl_list = (u_int *) malloc(sizeof(u_int) * (bdl.bfl_len + 1)); if (bdl.bfl_list == NULL) { (void)snprintf(ebuf, PCAP_ERRBUF_SIZE, "malloc: %s", pcap_strerror(errno));