[U-Boot] cmd: nvedit: env_get_f must check for env_get_char error codes
Tom Rini
trini at konsulko.com
Thu Feb 1 13:09:02 UTC 2018
On Wed, Jan 31, 2018 at 07:56:48AM +0100, Simon Goldschmidt wrote:
> env_get_f calls env_get_char to load single characters from the
> environment. However, the return value of env_get_char was not
> checked for errors. Now if the env driver does not support the
> .get_char call, env_get_f did not notice this and looped over the
> whole size of the environment, calling env_get_char over 8000
> times with the default settings, just to return an error in the
> end.
>
> Fix this by checking if env_get_char returns < 0.
>
> Signed-off-by: Simon Goldschmidt <sgoldschmidt at de.pepperl-fuchs.com>
> Acked-by: Maxime Ripard <maxime.ripard at free-electrons.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180201/5c07424e/attachment.sig>
More information about the U-Boot
mailing list