From owner-freebsd-hackers@FreeBSD.ORG Sun Sep 4 23:04:47 2011 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 996251065676 for ; Sun, 4 Sep 2011 23:04:47 +0000 (UTC) (envelope-from olafBuddenhagen@gmx.net) Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.23]) by mx1.freebsd.org (Postfix) with SMTP id DC1F58FC1B for ; Sun, 4 Sep 2011 23:04:46 +0000 (UTC) Received: (qmail invoked by alias); 04 Sep 2011 22:38:04 -0000 Received: from port-92-195-29-21.dynamic.qsc.de (EHLO sky.local) [92.195.29.21] by mail.gmx.net (mp059) with SMTP; 05 Sep 2011 00:38:04 +0200 X-Authenticated: #1379927 X-Provags-ID: V01U2FsdGVkX1+0jvJ6G2m0blxquRlR96EO6Sb9K+bVc5cfPWXOHZ itEIjxaA3dKvoO Received: from 192.168.1.6 (ident=unknown) by sky.local with smtp (masqmail 0.2.27) id 1Qzgix-5uX-00; Sat, 03 Sep 2011 05:16:51 +0200 Received: by alien.local (sSMTP sendmail emulation); Sat, 03 Sep 2011 05:17:02 +0200 Date: Sat, 3 Sep 2011 05:17:02 +0200 From: To: Robert Millan Message-ID: <20110903031659.GR10284@alien.local> Mail-Followup-To: Robert Millan , freebsd-hackers@freebsd.org, Ed Maste , debian-hurd@lists.debian.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Y-GMX-Trusted: 0 X-Mailman-Approved-At: Sun, 04 Sep 2011 23:26:53 +0000 Cc: freebsd-hackers@freebsd.org, Ed Maste , debian-hurd@lists.debian.org Subject: Re: [PATCH] avoid assuming MAXPATHLEN in config(8) 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: Sun, 04 Sep 2011 23:04:47 -0000 Hi, On Thu, Jul 07, 2011 at 11:33:53AM +0200, Robert Millan wrote: > - (void)snprintf(fname, sizeof fname, "../../conf/options.%s", > + (void)asprintf(&fname, "../../conf/options.%s", > machinename); Ignoring the return value of asprintf() is not a good idea, as it can indicate a failed allocation. On a related note, the return value of strdup() also should be checked. -antrik-