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

Simon Glass
2011-09-26T18:25:12Z

HI Wolfgang,

On Sun, Sep 25, 2011 at 1:14 PM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Simon Glass,
>
> In message <CAPnjgZ0-8wU4Hj3pdmfNMWnj4EPUmQ69U_UARaRt5CbqQv0Ofg@mail.gmail.com> 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.

Yes that is a problem. Perhaps we could changes things so that this
CONFIG really only matters prior to relocation (see other thread with
Albert) and we could just choose a suitable small value like 256,
which seems to be the minimum for most boards.

Regards,
Simon

>
> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH, ? ? MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> "And it should be the law: If you use ?the ?word ?`paradigm' ?without
> knowing ?what ?the ?dictionary ?says ?it ?means, ?you ?go to jail. No
> exceptions." ? ? ? ? ? ? ? ? ? ? - David Jones @ Megatest Corporation
>