From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MWuHw-0006l9-Ha for mharc-grub-devel@gnu.org; Fri, 31 Jul 2009 11:44:56 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MWuHu-0006k7-CT for grub-devel@gnu.org; Fri, 31 Jul 2009 11:44:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MWuHp-0006hk-Pp for grub-devel@gnu.org; Fri, 31 Jul 2009 11:44:54 -0400 Received: from [199.232.76.173] (port=37780 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWuHp-0006ha-KE for grub-devel@gnu.org; Fri, 31 Jul 2009 11:44:49 -0400 Received: from xvm-190-8.ghst.net ([217.70.190.8]:45893 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 1MWuHo-00024b-Rt for grub-devel@gnu.org; Fri, 31 Jul 2009 11:44:49 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtp (Exim 4.69) (envelope-from ) id 1MWuHn-0000Or-8y for grub-devel@gnu.org; Fri, 31 Jul 2009 15:44:47 +0000 Received: from rmh by thorin with local (Exim 4.69) (envelope-from ) id 1MWuHm-0003pc-Gk for grub-devel@gnu.org; Fri, 31 Jul 2009 17:44:46 +0200 Date: Fri, 31 Jul 2009 17:44:46 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20090731154446.GC14675@thorin> References: <1340f8530907191211o53119415nf7510cc1e7a89ee1@mail.gmail.com> <1340f8530907271358g2634fe16w15d4297b1b8f30df@mail.gmail.com> <20090728174223.GC32726@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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: [PATCH] Bug fix for LVM 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, 31 Jul 2009 15:44:55 -0000 On Wed, Jul 29, 2009 at 11:22:56AM +0800, Bean wrote: > On Wed, Jul 29, 2009 at 1:42 AM, Robert Millan wrote: > > On Tue, Jul 28, 2009 at 11:15:09PM +0800, Bean wrote: > >> -  buf2 = grub_zalloc (size); > >> +  buf2 = grub_malloc (size); > >>    if (!buf2) > >>      return grub_errno; > >> > >> +  grub_memset (buf, 0, size); > > > > We just received 'buf' as parameter.  Why do we have to zero it here? > > Hi, > > Because we are in a recovery function, the original content may not be > correct, we need to clear it out before continue. Alright. I think a comment would help, it's not obvious why it's done this way. -- 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."