Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Gg7xR-0001et-D8 for mharc-grub-devel@gnu.org; Fri, 03 Nov 2006 17:56:17 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gg7xP-0001c1-Gv for grub-devel@gnu.org; Fri, 03 Nov 2006 17:56:15 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gg7xO-0001aG-0u for grub-devel@gnu.org; Fri, 03 Nov 2006 17:56:14 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gg7xN-0001Zz-Sc for grub-devel@gnu.org; Fri, 03 Nov 2006 17:56:13 -0500 Received: from [66.111.4.25] (helo=out1.smtp.messagingengine.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Gg7xN-0006Fq-Gm for grub-devel@gnu.org; Fri, 03 Nov 2006 17:56:13 -0500 Received: from db2.internal (db2.internal [10.202.2.12]) by frontend1.messagingengine.com (Postfix) with ESMTP id BAFBCDC01D8 for ; Fri, 3 Nov 2006 17:56:11 -0500 (EST) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by db2.internal (MEProxy); Fri, 03 Nov 2006 17:56:13 -0500 X-Sasl-enc: UYuLw2xSTSlaetpbpJDX047k3aJXa2O0m33fx/Hqb+os 1162594573 Received: from basalt.austin.ibm.com (bi01p1.co.us.ibm.com [32.97.110.142]) by mail.messagingengine.com (Postfix) with ESMTP id 774E6138F2 for ; Fri, 3 Nov 2006 17:56:13 -0500 (EST) From: Hollis Blanchard To: The development of GRUB 2 Content-Type: text/plain Date: Fri, 03 Nov 2006 16:56:10 -0600 Message-Id: <1162594570.14609.27.camel@basalt.austin.ibm.com> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 (2.6.3-1.fc5.5) Content-Transfer-Encoding: 7bit Subject: grub_read_file with len==0 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, 03 Nov 2006 22:56:15 -0000 grub_read_file() has this in it: if (len == 0 || len > file->size - file->offset) len = file->size - file->offset; This is a curious divergence from read(2), and bit me when loading an ELF segment with 0 p_filesz but non-0 p_memsz. Could we remove it? Why is it there in the first place? -Hollis