[U-Boot-Users] Bug in tools/fw_env.c ?

Robin Gilks robin.gilks at tait.co.nz
Wed Sep 14 06:30:18 CEST 2005


Greetings

Just a quick arm wave to see if I have the logic right.

In a redundant environment when both sets are corrupt, the env_init 
function sets the environment data pointer to the default data. If this 
is then added to by the fw_setenv function, the memory overwritten is 
not the calloc'ed space that is big enough to hold the extra data but 
the initialised memory of the program that contains the defaults! 
Methinks that the defaults should be memcpy'ed into the calloc'ed space.

I've not looked at the non-redundant env case.

-- 
Robin Gilks
Senior Design Engineer          Phone: (+64)(3) 357 1569
Tait Electronics                Fax  :  (+64)(3) 359 4632
PO Box 1645 Christchurch        Email : robin.gilks at tait.co.nz
New Zealand

=======================================================================
This email, including any attachments, is only for the intended
addressee.  It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
 altered or corrupted during transmission.
=======================================================================





More information about the U-Boot mailing list