Re: [U-Boot] [PATCH 3/4] Make printf and vprintf safe from buffer overruns

2011-09-26 Thread Simon Glass
Hi Wolfgang, On Mon, Sep 26, 2011 at 11:47 AM, Wolfgang Denk wrote: > Dear Simon Glass, > > In message > you > wrote: >> >> > If you can find one that fits for all boards? =A0Keep in mind that >> > printf() gets used before relocation, when available stack space may >> > be _very_ limited. >>

Re: [U-Boot] [PATCH 3/4] Make printf and vprintf safe from buffer overruns

2011-09-26 Thread Wolfgang Denk
Dear Simon Glass, In message you wrote: > > > If you can find one that fits for all boards? =A0Keep in mind that > > printf() gets used before relocation, when available stack space may > > be _very_ limited. > > Yes that is a problem. Perhaps we could changes things so that this > CONFIG real

Re: [U-Boot] [PATCH 3/4] Make printf and vprintf safe from buffer overruns

2011-09-26 Thread Simon Glass
HI Wolfgang, On Sun, Sep 25, 2011 at 1:14 PM, Wolfgang Denk wrote: > Dear Simon Glass, > > In message > you > wrote: >> >> Yes, indeed. Could we go as far as removing CONFIG_SYS_PBSIZE, and >> just use a standard value? > > If you can find one that fits for all boards?  Keep in mind that > pri

Re: [U-Boot] [PATCH 3/4] Make printf and vprintf safe from buffer overruns

2011-09-25 Thread Wolfgang Denk
Dear Simon Glass, In message you wrote: > > > in the context of I/O funcs, CONFIG_SYS_PBSIZE is the current standard > > OK - is there a reason why boards can redefine this? Many many boards > do. It seems like something that should just be given a sensible > value. Indeed - that's exactly wh

Re: [U-Boot] [PATCH 3/4] Make printf and vprintf safe from buffer overruns

2011-09-25 Thread Wolfgang Denk
Dear Simon Glass, In message you wrote: > > Yes, indeed. Could we go as far as removing CONFIG_SYS_PBSIZE, and > just use a standard value? If you can find one that fits for all boards? Keep in mind that printf() gets used before relocation, when available stack space may be _very_ limited.

Re: [U-Boot] [PATCH 3/4] Make printf and vprintf safe from buffer overruns

2011-09-23 Thread Simon Glass
Hi Mike, On Fri, Sep 23, 2011 at 3:36 PM, Mike Frysinger wrote: > On Friday, September 23, 2011 16:41:50 Simon Glass wrote: >> On Fri, Sep 23, 2011 at 1:31 PM, Mike Frysinger wrote: >> > On Friday, September 23, 2011 13:38:51 Simon Glass wrote: >> >> --- a/common/console.c >> >> +++ b/common/cons

Re: [U-Boot] [PATCH 3/4] Make printf and vprintf safe from buffer overruns

2011-09-23 Thread Mike Frysinger
On Friday, September 23, 2011 16:41:50 Simon Glass wrote: > On Fri, Sep 23, 2011 at 1:31 PM, Mike Frysinger wrote: > > On Friday, September 23, 2011 13:38:51 Simon Glass wrote: > >> --- a/common/console.c > >> +++ b/common/console.c > >> @@ -212,7 +212,7 @@ int serial_printf(const char *fmt, ...) >

Re: [U-Boot] [PATCH 3/4] Make printf and vprintf safe from buffer overruns

2011-09-23 Thread Simon Glass
Hi Mike, On Fri, Sep 23, 2011 at 1:31 PM, Mike Frysinger wrote: > On Friday, September 23, 2011 13:38:51 Simon Glass wrote: >> --- a/common/console.c >> +++ b/common/console.c >> @@ -212,7 +212,7 @@ int serial_printf(const char *fmt, ...) >>       /* For this to work, printbuffer must be larger t

Re: [U-Boot] [PATCH 3/4] Make printf and vprintf safe from buffer overruns

2011-09-23 Thread Mike Frysinger
On Friday, September 23, 2011 13:38:51 Simon Glass wrote: > --- a/common/console.c > +++ b/common/console.c > @@ -212,7 +212,7 @@ int serial_printf(const char *fmt, ...) > /* For this to work, printbuffer must be larger than >* anything we ever want to print. >*/ > - i = v

Re: [U-Boot] [PATCH 3/4] Make printf and vprintf safe from buffer overruns

2011-09-23 Thread Simon Glass
Hi Kumar, On Fri, Sep 23, 2011 at 11:36 AM, Kumar Gala wrote: > > On Sep 23, 2011, at 12:38 PM, Simon Glass wrote: > >> From: Sonny Rao >> >> From: Sonny Rao >> >> utilize the added vscnprintf functions to avoid buffer overruns >> The implementation is fairly dumb in that it doesn't detect >> t

Re: [U-Boot] [PATCH 3/4] Make printf and vprintf safe from buffer overruns

2011-09-23 Thread Kumar Gala
On Sep 23, 2011, at 12:38 PM, Simon Glass wrote: > From: Sonny Rao > > From: Sonny Rao > > utilize the added vscnprintf functions to avoid buffer overruns > The implementation is fairly dumb in that it doesn't detect > that the buffer is too small, but at least will not cause crashes. > > Si

[U-Boot] [PATCH 3/4] Make printf and vprintf safe from buffer overruns

2011-09-23 Thread Simon Glass
From: Sonny Rao From: Sonny Rao utilize the added vscnprintf functions to avoid buffer overruns The implementation is fairly dumb in that it doesn't detect that the buffer is too small, but at least will not cause crashes. Signed-off-by: Simon Glass --- common/console.c | 10 +- 1