public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] memset bug in ext2fs_read_file()
@ 2007-12-20  6:34 Mike Montour
  2008-01-09  9:15 ` Wolfgang Denk
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Montour @ 2007-12-20  6:34 UTC (permalink / raw)
  To: u-boot

Hello,

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).

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot-Users] memset bug in ext2fs_read_file()
  2007-12-20  6:34 [U-Boot-Users] memset bug in ext2fs_read_file() Mike Montour
@ 2008-01-09  9:15 ` Wolfgang Denk
  2008-01-10 21:27   ` Reinhard Arlt
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Denk @ 2008-01-09  9:15 UTC (permalink / raw)
  To: u-boot

Dear Mike,

in message <fkd2di$pdl$1@ger.gmane.org> 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

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Probably the best operating system in the world  is  the  [operating
system] made for the PDP-11 by Bell Laboratories."
                                           - Ted Nelson, October 1977

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot-Users] memset bug in ext2fs_read_file()
  2008-01-09  9:15 ` Wolfgang Denk
@ 2008-01-10 21:27   ` Reinhard Arlt
  0 siblings, 0 replies; 3+ messages in thread
From: Reinhard Arlt @ 2008-01-10 21:27 UTC (permalink / raw)
  To: u-boot

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 <fkd2di$pdl$1@ger.gmane.org> 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
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-01-10 21:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-20  6:34 [U-Boot-Users] memset bug in ext2fs_read_file() Mike Montour
2008-01-09  9:15 ` Wolfgang Denk
2008-01-10 21:27   ` Reinhard Arlt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox