From owner-freebsd-stable@FreeBSD.ORG Thu Apr 8 12:16:22 2004 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 11E5816A4CE; Thu, 8 Apr 2004 12:16:22 -0700 (PDT) Received: from sccrmhc13.comcast.net (sccrmhc13.comcast.net [204.127.202.64]) by mx1.FreeBSD.org (Postfix) with ESMTP id A86D343D46; Thu, 8 Apr 2004 12:16:21 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (sccrmhc13) with ESMTP id <20040408191620016003h5f1e>; Thu, 8 Apr 2004 19:16:21 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id MAA64404; Thu, 8 Apr 2004 12:16:18 -0700 (PDT) Date: Thu, 8 Apr 2004 12:16:16 -0700 (PDT) From: Julian Elischer To: freebsd-stable@freebsd.org In-Reply-To: <20040408190121.407A516A4D3@hub.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Ruslan Ermilov Subject: Re: ng_bridge(4) has an easily exploitable memory leak X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Apr 2004 19:16:22 -0000 Ruslan, B IGNORE THE PREVIOUS EMAIL I was looking at how the macro expanded in -current, not in -stable.. [...] > > > I leave it up to you to decide which you prefer, (but remember that > NG_SEND_DATA is a macro and expads somewhat. > > specifically, to (sorry about linewrap): > #define NG_SEND_DATA(error, hook, m, meta) \ > do {\ > item_p _item; \ > if ((_item = ng_package_data((m), (meta)))) {\ > NG_FWD_ITEM_HOOK(error, _item, hook); \ > } else { \ > (error) = ENOMEM; \ > }\ > (m) = NULL; \ > (meta) = NULL; \ > } while (0) > > where NG_FWD_ITEM_HOOK > itself expands to: > #define NG_FWD_ITEM_HOOK(error, item, hook) \ > do { \ > (error) = \ > ng_address_hook(NULL, (item), (hook), 0); \ > if (error == 0) { \ > SAVE_LINE(item); \ > (error) = ng_snd_item((item), 0); \ > } \ > (item) = NULL; \ > } while (0) > > so only having one of those saves a bit of code. > Maybe I should listen to myself and fix -current to follow my own advice!