From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NWTpu-0005g8-BY for mharc-grub-devel@gnu.org; Sun, 17 Jan 2010 07:02:30 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NWTpr-0005fD-Oi for grub-devel@gnu.org; Sun, 17 Jan 2010 07:02:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NWTpn-0005dW-Mm for grub-devel@gnu.org; Sun, 17 Jan 2010 07:02:27 -0500 Received: from [199.232.76.173] (port=36921 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NWTpn-0005dS-I7 for grub-devel@gnu.org; Sun, 17 Jan 2010 07:02:23 -0500 Received: from fg-out-1718.google.com ([72.14.220.153]:22596) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NWTpm-0000W5-2G for grub-devel@gnu.org; Sun, 17 Jan 2010 07:02:22 -0500 Received: by fg-out-1718.google.com with SMTP id e21so314145fga.12 for ; Sun, 17 Jan 2010 04:02:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type; bh=txt3NlH9tnikKJIby2bfBxtLF47OiKpSiDvTNNdjsGY=; b=alb0CgwKfflaCQk4ToCIgEOZM8fgTCJNLFPsiczne8ceeAMeV/yvVRojV85LcUjIkI 7e9cjJpuuF7UOAN2kmKcvGxt26+h/JAbSqpk92TJl779co244D5fVp8d5+NP5HQMxzIg VNYH2lHIE/V1gnWNLOb//DtfYUJlQWZf2GR8Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; b=BtTKGWcEuFV734425dLinFDMgktPh8HaPAE2c121DMBTsdnUxG3sJw6swGhT+4+pq2 bUlyprchgDs7nmxLGhHFIZxZ5DkkpKJ6+/GlfOC0MplFNKXpL3O63lvOqqyPqkvQHpxM RZX5HwpYkYCgfEhXnhvdakuoFCPye2y70JKo8= Received: by 10.87.69.17 with SMTP id w17mr2645121fgk.41.1263729738986; Sun, 17 Jan 2010 04:02:18 -0800 (PST) Received: from debian.bg45.phnet (144-116.203-62.cust.bluewin.ch [62.203.116.144]) by mx.google.com with ESMTPS id 12sm8469777fgg.7.2010.01.17.04.02.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 17 Jan 2010 04:02:18 -0800 (PST) Message-ID: <4B52FC48.2040208@gmail.com> Date: Sun, 17 Jan 2010 13:02:16 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109) MIME-Version: 1.0 To: The development of GNU GRUB References: <4B39CC24.9060607@gmail.com> <20100101115158.GF3692@thorin> In-Reply-To: <20100101115158.GF3692@thorin> X-Enigmail-Version: 0.95.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig4C183C85E8F17037F1E2EB0A" X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] switch from sprintf to asprintf and snprintf X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2010 12:02:28 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig4C183C85E8F17037F1E2EB0A Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Robert Millan wrote: > On Tue, Dec 29, 2009 at 10:30:12AM +0100, Vladimir '=CF=86-coder/phcode= r' Serbinenko wrote: > =20 >> sprintf is potentially dangerous especially with gettext, when message= s >> may be larger than coder would expect. I attach the patch to fix it >> =20 > > Could you split the patches into one for asprintf and one for *nprintf?= The > asprintf one is something I'd really like to see in trunk. For the res= t I'm > not so sure. > =20 Implementing sprintf on top of this would be just a waste. It would need to add conditions to ignore size limits. IMHO unavailability of sprintf decreases temptaion of making a 1024-bytes buffer and hoping it fits, or at very least we don't have a memory corruption when it doesn't --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enig4C183C85E8F17037F1E2EB0A Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iF4EAREKAAYFAktS/EkACgkQNak7dOguQgmydAEAmoPDqjZ0bnfqAbsHmbniCqmc zePxnBDSuFJeWEE0OgIA/2zggi3q3ghnao+U1VN/Zxe77B/oUZDiM18mFuhyx9lD =wfmB -----END PGP SIGNATURE----- --------------enig4C183C85E8F17037F1E2EB0A--