From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 10 20:13:45 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3CAF106566C; Tue, 10 Nov 2009 20:13:45 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 81CA88FC0C; Tue, 10 Nov 2009 20:13:44 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id D41446D41B; Tue, 10 Nov 2009 20:13:43 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 7B800844CC; Tue, 10 Nov 2009 21:13:43 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Alexander Best References: Date: Tue, 10 Nov 2009 21:13:43 +0100 In-Reply-To: (Alexander Best's message of "Tue, 10 Nov 2009 17:17:38 +0100 (CET)") Message-ID: <86y6me2l54.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Giorgos Keramidas , Nate Eldredge Subject: Re: [patch] burncd: honour for envar SPEED X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2009 20:13:45 -0000 Alexander Best writes: > you're right. hundreds of functions cause segfaults when arg or args > are NULL. either we add safety checks for all of them (massive > overhead) or just leave them the way they are. The consensus in the C community is that adding such checks does more harm than good, because a NULL pointer is usually a symptom of a bug somewhere else in the application, and checking for a NULL pointer will either hide that bug or trigger another error somewhere down the line, possibly making the real bug harder to find, rather than easier. (next week's topic: the return value of malloc(0)...) DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no