From mboxrd@z Thu Jan 1 00:00:00 1970 From: Reinhard Arlt Date: Thu, 10 Jan 2008 22:27:21 +0100 Subject: [U-Boot-Users] memset bug in ext2fs_read_file() In-Reply-To: <20080109091521.98FC06F0010@nyx.denx.de> References: <20080109091521.98FC06F0010@nyx.denx.de> Message-ID: <47868DB9.5080800@t-online.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello, this was bug! You will run into this situation, when you use a file with "holes" in it. (Not so likely with a systen image). Best regards Reinhard Arlt Wolfgang Denk wrote: > Dear Mike, > > in message you wrote: >> The ext2fs_read_file() function in fs/ext2/ext2fs.c contains the >> following line: >> >> 439 memset (buf, blocksize - skipfirst, 0); >> >> This is incorrect as the prototype of the function has the fill value as >> the 2nd parameter and the number of bytes as the 3rd: >> >> void *memset(void *b, int c, size_t n); >> >> I don't have any test code that is affected by this bug. I noticed it >> when I was investigating a different problem (with OpenMoko). > > Thanks, applied. > > Best regards, > > Wolfgang Denk >