From 6bf6a28af37230c5ca61c232f2749a46397da00a Mon Sep 17 00:00:00 2001 From: sam Date: Mon, 4 Sep 2006 20:12:45 +0000 Subject: sigh, put back buffer overflow fix of 1.1.11 that seems to have not gone into the 0.9.4 release; don't put it on the vendor branch so we won't lose it on the next import if they continue to lose it --- contrib/libpcap/pcap-bpf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/libpcap/pcap-bpf.c b/contrib/libpcap/pcap-bpf.c index 97bd602..863827f 100644 --- a/contrib/libpcap/pcap-bpf.c +++ b/contrib/libpcap/pcap-bpf.c @@ -17,6 +17,8 @@ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $FreeBSD$ */ #ifndef lint static const char rcsid[] _U_ = @@ -746,7 +748,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)); -- cgit v1.1