Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MjbxC-0008Sn-VT for mharc-grub-devel@gnu.org; Fri, 04 Sep 2009 12:48:03 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MjbxA-0008Ow-MU for grub-devel@gnu.org; Fri, 04 Sep 2009 12:48:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mjbx4-0008CV-Ef for grub-devel@gnu.org; Fri, 04 Sep 2009 12:47:59 -0400 Received: from [199.232.76.173] (port=33113 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mjbx4-0008C5-4k for grub-devel@gnu.org; Fri, 04 Sep 2009 12:47:54 -0400 Received: from mail.dasr.de ([217.69.77.164]:3631) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mjbx3-0004Zq-NO for grub-devel@gnu.org; Fri, 04 Sep 2009 12:47:53 -0400 Received: from c-24-91-125-189.hsd1.ma.comcast.net ([24.91.125.189] helo=plato.walfield.org.walfield.org) by mail.dasr.de with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1MjbwZ-0005sg-M0 for grub-devel@gnu.org; Fri, 04 Sep 2009 18:47:23 +0200 Date: Fri, 04 Sep 2009 18:47:17 +0200 Message-ID: <87vdjyac8a.wl%neal@walfield.org> From: "Neal H. Walfield" To: The development of GRUB 2 In-Reply-To: <20090902014939.GM13423@riva.ucam.org> References: <20090902014939.GM13423@riva.ucam.org> User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.7 Emacs/22.3 (i486-pc-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Subject: Re: [PATCH] Introduce xasprintf X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Sep 2009 16:48:01 -0000 At Wed, 2 Sep 2009 02:49:39 +0100, Colin Watson wrote: > +#ifndef HAVE_VASPRINTF > + > +int > +vasprintf (char **buf, const char *fmt, va_list ap) > +{ > + /* Should be large enough. */ > + *buf = xmalloc (512); > + > + return vsprintf (*buf, fmt, ap); > +} > + > +#endif Perhaps check that the number of characters is not more than 512 (if so, panic). Neal