[U-Boot] common: env_flags: fix loop condition when using env_flags_varaccess_mask

Tom Rini trini at konsulko.com
Thu Jan 14 14:22:29 CET 2016


On Tue, Jan 12, 2016 at 05:23:12PM +0800, Peng Fan wrote:

> From: Peng Fan <peng.fan at nxp.com>
> 
> We should use ARRAY_SIZE, but not sizeof. The size of
> env_flags_varaccess_mask is 16bytes, but we only need 4 loops.
> If using 16 as the end condition, we may access memory that
> not belong to array env_flags_varaccess_mask.
> 
> Signed-off-by: Peng Fan <peng.fan at nxp.com>
> Cc: Joe Hershberger <joe.hershberger at ni.com>
> Cc: York Sun <yorksun at freescale.com>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Tom Rini <trini at konsulko.com>
> Reviewed-by: Simon Glass <sjg at chromium.org>
> Acked-by: Joe Hershberger <joe.hershberger at ni.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160114/2883e166/attachment.sig>


More information about the U-Boot mailing list