From owner-freebsd-ipfw@FreeBSD.ORG Wed Aug 25 11:19:11 2004 Return-Path: Delivered-To: freebsd-ipfw@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3806F16A4CE for ; Wed, 25 Aug 2004 11:19:11 +0000 (GMT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2FD1E43D49 for ; Wed, 25 Aug 2004 11:19:11 +0000 (GMT) (envelope-from mux@freebsd.org) Received: by elvis.mu.org (Postfix, from userid 1920) id 23DF75C8D8; Wed, 25 Aug 2004 04:19:11 -0700 (PDT) Date: Wed, 25 Aug 2004 13:19:11 +0200 From: Maxime Henrion To: Pawel Malachowski Message-ID: <20040825111911.GE92931@elvis.mu.org> References: <20040825110455.GB57463@shellma.zin.lublin.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040825110455.GB57463@shellma.zin.lublin.pl> User-Agent: Mutt/1.4.2.1i cc: ipfw@freebsd.org Subject: Re: (not) Protecting of case IP_FW_GET. X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2004 11:19:11 -0000 Pawel Malachowski wrote: > Another thing, in HEAD, there are three mallocs with M_WAITOK flag, only > one of them checks if malloc succeed (lookup tables code) and returns > ENOMEM, if not. Another two are assuming malloc will always succeed. > In RELENG_4, result is checked and ENOBUFS (why not ENOMEM?) is returned > if malloc failed. The case where it checks the return value of malloc() is wrong. When called with the M_WAITOK flag, malloc() is not supposed to return NULL. Cheers, Maxime