From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MnDbm-0006Ws-Dw for mharc-grub-devel@gnu.org; Mon, 14 Sep 2009 11:36:50 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MnDbk-0006Ty-9q for grub-devel@gnu.org; Mon, 14 Sep 2009 11:36:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MnDbf-0006Nl-AZ for grub-devel@gnu.org; Mon, 14 Sep 2009 11:36:47 -0400 Received: from [199.232.76.173] (port=37231 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnDbf-0006Nb-5j for grub-devel@gnu.org; Mon, 14 Sep 2009 11:36:43 -0400 Received: from xvm-190-8.ghst.net ([217.70.190.8]:45742 helo=aybabtu.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MnDbe-0005DM-QA for grub-devel@gnu.org; Mon, 14 Sep 2009 11:36:43 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtp (Exim 4.69) (envelope-from ) id 1MnDbd-00086N-BV for grub-devel@gnu.org; Mon, 14 Sep 2009 17:36:41 +0200 Received: from rmh by thorin with local (Exim 4.69) (envelope-from ) id 1MnDbc-0006dD-R8 for grub-devel@gnu.org; Mon, 14 Sep 2009 17:36:40 +0200 Date: Mon, 14 Sep 2009 17:36:40 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20090914153640.GC25403@thorin> References: <20090914084542.GK13423@riva.ucam.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090914084542.GK13423@riva.ucam.org> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.18 (2008-05-17) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: testing a loopback device without filesystem causes a crash 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: Mon, 14 Sep 2009 15:36:48 -0000 On Mon, Sep 14, 2009 at 09:45:42AM +0100, Colin Watson wrote: > On Sun, Sep 13, 2009 at 07:58:56PM +0100, ago wrote: > > On fezie's request I am reporting a possible bug that I experienced > > when running the following: > > > > loopback loop0 /path/to/myfile > > if [ -e (loop0)/some/file ]; then > > echo ok > > fi > > > > If /path/to/myfile does not contain a filesystem, grub2 crashes (there > > is a sudden restart) when I run the test. > > The following patch fixes this. OK to commit? > > 2009-09-14 Colin Watson > > * commands/test.c (get_fileinfo): Return immediately if > grub_fs_probe fails. > > Index: commands/test.c > =================================================================== > --- commands/test.c (revision 2593) > +++ commands/test.c (working copy) > @@ -88,6 +88,13 @@ test_parse (char **args, int *argn, int argc) > } > > fs = grub_fs_probe (dev); > + if (! fs) > + { > + grub_free (device_name); > + grub_device_close (dev); > + return; > + } > + Of course! -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."