From owner-freebsd-current@FreeBSD.ORG Mon Jan 16 18:03:37 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AEAA816A41F for ; Mon, 16 Jan 2006 18:03:37 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.95]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A38C43D5D for ; Mon, 16 Jan 2006 18:03:32 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from flame.pc (aris.bedc.ondsl.gr [62.103.39.226]) by kane.otenet.gr (8.13.4/8.13.4/Debian-8) with SMTP id k0GI3EI3021073; Mon, 16 Jan 2006 20:03:14 +0200 Received: by flame.pc (Postfix, from userid 1001) id 1B34A11718; Mon, 16 Jan 2006 20:03:13 +0200 (EET) Date: Mon, 16 Jan 2006 20:03:13 +0200 From: Giorgos Keramidas To: Sam Leffler Message-ID: <20060116180312.GA1742@flame.pc> References: <20060116013722.GA29139@xor.obsecurity.org> <20060116135928.GB28974@flame.pc> <43CBD81E.80006@errno.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43CBD81E.80006@errno.com> Cc: current@freebsd.org, Kris Kennaway Subject: Re: malloc bugs with tcpdump X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2006 18:03:37 -0000 On 2006-01-16 09:30, Sam Leffler wrote: > I sent the attached patch upstream to the tcpdump folks. Once I hear > back I'll commit it. Thanks :) > Index: pcap-bpf.c > =================================================================== > RCS file: /usr/ncvs/src/contrib/libpcap/pcap-bpf.c,v > retrieving revision 1.1.1.10 > diff -u -r1.1.1.10 pcap-bpf.c > --- pcap-bpf.c 11 Jul 2005 03:24:42 -0000 1.1.1.10 > +++ pcap-bpf.c 16 Jan 2006 05:48:49 -0000 > @@ -746,7 +746,7 @@ > 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));