From: Tom Rini Date: Thu, 14 Jan 2016 08:22:29 -0500 Subject: [U-Boot] common: env_flags: fix loop condition when using env_flags_varaccess_mask In-Reply-To: <1452590592-15921-1-git-send-email-van.freenix@gmail.com> References: <1452590592-15921-1-git-send-email-van.freenix@gmail.com> Message-ID: <20160114132229.GW3359@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, Jan 12, 2016 at 05:23:12PM +0800, Peng Fan wrote: > From: Peng Fan > > 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 > Cc: Joe Hershberger > Cc: York Sun > Cc: Simon Glass > Cc: Tom Rini > Reviewed-by: Simon Glass > Acked-by: Joe Hershberger 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: