From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Mon, 1 Nov 2010 14:06:57 +0100 Subject: [U-Boot] [PATCH] UBIFS: Change ubifsload to not read beyond the requested size In-Reply-To: <20101029205404.71F62BB0AD@gemini.denx.de> References: <1288343093-31276-1-git-send-email-sr@denx.de> <20101029205404.71F62BB0AD@gemini.denx.de> Message-ID: <201011011406.57956.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 Wolfgang, On Friday 29 October 2010 22:54:04 Wolfgang Denk wrote: > > + buff = malloc(UBIFS_BLOCK_SIZE); > > + > > + /* Read block-siez into temp buffer */ > > + ret = read_block(inode, buff, block, dn); > > + if (last_block_size) > > + dlen = last_block_size; > > + else > > + dlen = le32_to_cpu(dn->size); > > How about some error handling? > > malloc() can fail, and read_block() can fail as well. Right. I'll change this and send an updated version. Thanks for the review. 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