From owner-freebsd-current@FreeBSD.ORG Mon Jan 16 22:11:38 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 33DD216A41F for ; Mon, 16 Jan 2006 22:11:38 +0000 (GMT) (envelope-from q@galgenberg.net) Received: from wrzx35.rz.uni-wuerzburg.de (wrzx35.rz.uni-wuerzburg.de [132.187.3.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0054743D55 for ; Mon, 16 Jan 2006 22:11:30 +0000 (GMT) (envelope-from q@galgenberg.net) Received: from amavis.mail (amavis1.rz.uni-wuerzburg.de [132.187.3.46]) by wrzx35.rz.uni-wuerzburg.de (Postfix) with ESMTP id C6803E7AB8; Mon, 16 Jan 2006 23:11:28 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by amavis.mail (Postfix) with ESMTP id B929D9D9; Mon, 16 Jan 2006 23:11:28 +0100 (CET) Received: from wrzx28.rz.uni-wuerzburg.de (wrzx28.rz.uni-wuerzburg.de [132.187.3.28]) by amavis.mail (Postfix) with ESMTP id 968028F5; Mon, 16 Jan 2006 23:11:28 +0100 (CET) Received: from frodo.galgenberg.net (wwsx14.win-screen.uni-wuerzburg.de [132.187.253.14]) by wrzx28.rz.uni-wuerzburg.de (Postfix) with ESMTP id 259651464A6; Mon, 16 Jan 2006 23:11:28 +0100 (CET) Received: from coyote.q.local (gb-21-237.galgenberg.net [172.16.21.237]) by frodo.galgenberg.net (8.13.1/8.13.1) with ESMTP id k0GMBRao034613; Mon, 16 Jan 2006 23:11:27 +0100 (CET) (envelope-from q@galgenberg.net) Received: from roadrunner.q.local (roadrunner.q.local [192.168.0.148]) by coyote.q.local (8.13.4/8.13.4) with ESMTP id k0GMBRaC088277; Mon, 16 Jan 2006 23:11:27 +0100 (CET) (envelope-from q@galgenberg.net) Received: from roadrunner.q.local (localhost [127.0.0.1]) by roadrunner.q.local (8.13.4/8.13.4) with ESMTP id k0GMBRF1071661; Mon, 16 Jan 2006 23:11:27 +0100 (CET) (envelope-from q@galgenberg.net) Received: (from q@localhost) by roadrunner.q.local (8.13.4/8.13.4/Submit) id k0GMBQTM071660; Mon, 16 Jan 2006 23:11:26 +0100 (CET) (envelope-from q@galgenberg.net) Date: Mon, 16 Jan 2006 23:11:26 +0100 From: Ulrich Spoerlein To: Sam Leffler Message-ID: <20060116221126.GB1077@galgenberg.net> Mail-Followup-To: Sam Leffler , current@freebsd.org References: <20060116013722.GA29139@xor.obsecurity.org> <20060116135928.GB28974@flame.pc> <43CBD81E.80006@errno.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="R3G7APHDIzY6R/pk" Content-Disposition: inline In-Reply-To: <43CBD81E.80006@errno.com> X-Virus-Scanned: by amavisd-new at uni-wuerzburg.de X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=8.0 tests= X-Spam-Level: Cc: current@freebsd.org 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 22:11:38 -0000 --R3G7APHDIzY6R/pk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Sam Leffler wrote: > I sent the attached patch upstream to the tcpdump folks. Once I hear bac= k I'll commit it. >=20 > Sam > Index: pcap-bpf.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > 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; > =20 > - bdl.bfl_list =3D (u_int *) malloc(sizeof(u_int) * bdl.bfl_len + 1); > + bdl.bfl_list =3D (u_int *) malloc(sizeof(u_int) * (bdl.bfl_len + 1)); > if (bdl.bfl_list =3D=3D NULL) { > (void)snprintf(ebuf, PCAP_ERRBUF_SIZE, "malloc: %s", > pcap_strerror(errno)); Hi Sam, heh, I was trying to figure this one out earlier, but I gave up after a couple of minutes, as I couldn't figure out why in god's name the malloc would be too small to produce an error. Nice catch. Ulrich Spoerlein --=20 PGP Key ID: F0DB9F44 Encrypted mail welcome! Fingerprint: F1CE D062 0CA9 ADE3 349B 2FE8 980A C6B5 F0DB 9F44 Which is worse: ignorance or apathy? Don't know. Don't care. --R3G7APHDIzY6R/pk Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFDzBoO524iJyD+6d0RAoMuAKCxbTveHTHsnF0JCwvtsDETujBGBQCgsuDq evATWdYow3857oVEahV5ZRI= =UoW5 -----END PGP SIGNATURE----- --R3G7APHDIzY6R/pk--