From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1YnfGo-0004Fm-1X for mharc-grub-devel@gnu.org; Wed, 29 Apr 2015 23:36:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnfGl-0004FI-Sv for grub-devel@gnu.org; Wed, 29 Apr 2015 23:36:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnfGg-00051x-Mr for grub-devel@gnu.org; Wed, 29 Apr 2015 23:36:11 -0400 Received: from mail-lb0-x234.google.com ([2a00:1450:4010:c04::234]:32930) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnfGg-00051s-FA for grub-devel@gnu.org; Wed, 29 Apr 2015 23:36:06 -0400 Received: by lbbzk7 with SMTP id zk7so34939664lbb.0 for ; Wed, 29 Apr 2015 20:36:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=aBP2tZ2Dg1HGTuccKRXIv98+LR0jViz6+RfnezCy708=; b=iEjxIWI0BpRHhP0Edcd7X4dyiNisWnL+BRSJ8f2EJTNWzKTku8TiHbOxByxKsgs4/b xG3Xzfx8BvfIimimgMdDDWxE57vWmZ0q5ye1U50PLC8MhJb7rW79/EbaMxg6wJ16MLvI cU7OhSJHIIRREyA2Lf6cGYZafoMAO+w/MJ9FMk+xPxUtFXNruSn6VxqRsiVwnZGPHGY2 l8ShxeN52ANLb9vCRZOIRFrgSrckbF3NI7UuCajRdqFkB1nZ6ns0gLvop/VjrFi/0TiW C7VQYiSY2e/tai173piIn5a5R2KjKPi6kVGINY6xjYUFtHBpGqrLzOLEhs9zJ44jcnAP 3ZgA== X-Received: by 10.152.44.169 with SMTP id f9mr1948131lam.7.1430364965692; Wed, 29 Apr 2015 20:36:05 -0700 (PDT) Received: from opensuse.site (ppp91-76-14-38.pppoe.mtu-net.ru. [91.76.14.38]) by mx.google.com with ESMTPSA id sh6sm231851lbb.31.2015.04.29.20.36.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Apr 2015 20:36:04 -0700 (PDT) Date: Thu, 30 Apr 2015 06:36:03 +0300 From: Andrei Borzenkov To: "Vladimir 'phcoder' Serbinenko" Subject: Re: Using memdisk with grub2 and a gzip-compressed ISO Message-ID: <20150430063603.19f867be@opensuse.site> In-Reply-To: References: <20150429204501.1d3e1021@opensuse.site> X-Mailer: Claws Mail 3.11.0 (GTK+ 2.24.27; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::234 Cc: The development of GRUB 2 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, 30 Apr 2015 03:36:12 -0000 =D0=92 Wed, 29 Apr 2015 20:35:10 +0200 "Vladimir 'phcoder' Serbinenko" =D0=BF=D0=B8=D1=88=D0= =B5=D1=82: > > @@ -253,6 +256,9 @@ grub_initrd_load (struct grub_linux_initrd_context > *initrd_ctx, > > { > > grub_ssize_t cursize; > > > > + grub_memset (ptr, 0, ALIGN_UP_OVERHEAD ((grub_addr_t)ptr, 4)); > > + ptr +=3D ALIGN_UP_OVERHEAD ((grub_addr_t)ptr, 4); > > + > Please don't abuse the pointer this way. Is it better? grub_memset (ptr, 0, ALIGN_UP_OVERHEAD (ptr - (grub_uint8_t *)target, 4)); ptr +=3D ALIGN_UP_OVERHEAD (ptr - (grub_uint8_t *)target, 4);