From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Sa4bF-0002jR-1O for mharc-grub-devel@gnu.org; Thu, 31 May 2012 08:35:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sa4b9-0002ip-FF for grub-devel@gnu.org; Thu, 31 May 2012 08:35:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sa4b4-0000m2-9w for grub-devel@gnu.org; Thu, 31 May 2012 08:35:27 -0400 Received: from mail-ee0-f41.google.com ([74.125.83.41]:60810) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sa4b4-0000ld-0q for grub-devel@gnu.org; Thu, 31 May 2012 08:35:22 -0400 Received: by eekb47 with SMTP id b47so332368eek.0 for ; Thu, 31 May 2012 05:35:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; bh=vWyD1aB1M64DW8EUoxwIbfNSUnBtuM2faHq0F+JnTbs=; b=oba3ajIomJlq/qM7cs+u+0VrJdbTsFWVSheXv5mKC6ixCKK17shdyMoniz6IeF7X6j RrXn0li0a0W5CZnKfoicR+ABlYxVbtotbG/fxBxF5rs4a0uUYidr0bk22lDRntm5f/6U aaKJS97ZFK6So/gvmCbIqMywEXsMm0oPovkv2o2smFwxTgM9dk+JKazsoTSsEhuhSTMC 7aql3izn+YI4tkA+BsCejHAqTfAqbxip6r35biaN9FQUvKl4lR5zo7C6Tw2vMX91EbXQ eus3gCVJT34LZor0VV1E51KnKDqbBt+XmphmNx+J/aQJ38gqTBHk2KtVM0Z6sP6Zawni dbrQ== Received: by 10.14.127.132 with SMTP id d4mr969750eei.116.1338467719847; Thu, 31 May 2012 05:35:19 -0700 (PDT) Received: from debian.x201.phnet (59-232.197-178.cust.bluewin.ch. [178.197.232.59]) by mx.google.com with ESMTPS id e45sm4460831eeb.6.2012.05.31.05.35.18 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 31 May 2012 05:35:19 -0700 (PDT) Message-ID: <4FC76582.8040501@gmail.com> Date: Thu, 31 May 2012 14:35:14 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.4) Gecko/20120510 Icedove/10.0.4 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH] fix off-by-one in grub_file_getline References: <20120531114329.5438760D07@zoo.weinigel.se> In-Reply-To: <20120531114329.5438760D07@zoo.weinigel.se> X-Enigmail-Version: 1.4.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig92B3F0371544389D1A068675" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.83.41 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 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: Thu, 31 May 2012 12:35:31 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig92B3F0371544389D1A068675 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Committed, thanks. Could you supply ChangeLog entry next time? On 31.05.2012 13:43, Christer Weinigel wrote: > I'd like to submit a few trivial patches that I've had on my hard > drive for a while. This patch is against the latest version in the > trunk on bzr.savannah.gnu.org. >=20 > If grub_file_getline tries to read a line which is exactly > 64 bytes long it will write the terminating zero past the > end of the allocated buffer causing memory corruption. >=20 > Trivial fix which reserves one more byte in the buffer. >=20 > diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c > index feeb1ef..eb4b1c7 100644 > --- a/grub-core/normal/main.c > +++ b/grub-core/normal/main.c > @@ -65,7 +65,7 @@ grub_file_getline (grub_file_t file) > continue; > =20 > =20 > - if (pos >=3D max_len) > + if (pos + 1 >=3D max_len) > { > char *old_cmdline =3D cmdline; > max_len =3D max_len * 2; >=20 --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enig92B3F0371544389D1A068675 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.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAk/HZYIACgkQNak7dOguQglTUQEAl+On9ZUzTNCMJ2zIrCEKsG7m SecDe48/iG7mWCLSj1YA/A4nnDOIC00YzC4vGz2i5shEr6yqSjmzFhNDdQckcNS3 =jmID -----END PGP SIGNATURE----- --------------enig92B3F0371544389D1A068675--