From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Ripard Date: Wed, 31 Jan 2018 09:39:13 +0100 Subject: [U-Boot] [PATCH] cmd: nvedit: env_get_f must check for env_get_char error codes In-Reply-To: <20180131065648.5490-1-sgoldschmidt@de.pepperl-fuchs.com> References: <20180131065648.5490-1-sgoldschmidt@de.pepperl-fuchs.com> Message-ID: <20180131083913.cnsjtjfl7mo2sor4@flea.lan> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 Acked-by: Maxime Ripard Thanks! Maxime -- Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: