From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Mon, 1 Nov 2010 16:47:43 +0100 Subject: [U-Boot] [PATCH] UBIFS: Change ubifsload to not read beyond the requested size In-Reply-To: References: <1288343093-31276-1-git-send-email-sr@denx.de> Message-ID: <201011011647.43795.sr@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Ben, On Friday 29 October 2010 16:01:18 Ben Gardiner wrote: > On Fri, Oct 29, 2010 at 5:04 AM, Stefan Roese wrote: > > Until now ubifsload pads the destination with 0 up to a multiple of > > UBIFS_BLOCK_SIZE (4KiB) while reading a file to memory. This patch > > changes this behaviour to only read to the requested length. This > > is either the file length or the length/size provided as parameter > > to the ubifsload command. > > > > Signed-off-by: Stefan Roese > > --- > > [...] > > + /* > > + * Reading last block? Make sure to not write > > beyond + * the requested size. > > + */ > > s/write/read/ No. This refers to not writing beyond the requested size in the destination buffer. So that nothing will be overwritten by this 4KiB padding. I'll change this comment a bit to make this clearer in the next patch version. > > [...] > > + /* Read block-siez into temp buffer */ > > s/siez/size/ Thanks for catching. Will change. Cheers, Stefan -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de