commit | aaf1a4acd0016e1a099446fbbfd741894e9b8aa2 | [log] [tgz] |
---|---|---|
author | Mario Six <mario.six@gdsys.cc> | Fri Jan 26 14:43:53 2018 +0100 |
committer | Stefan Roese <sr@denx.de> | Mon Jan 29 07:48:59 2018 +0100 |
tree | f9da3e31926758b9b6416388077a31fd56615212 | |
parent | 324b94005f2bad9784ad02906a080b69240becbe [diff] |
cfi_flash: Bound-check index before array access In a while loop in cfi_flash.c the array "start" is accessed at the index "sector" before the index variable "sector" is bounds-checked, which might lead to accesses beyond the bounds of the array. Swap the order of the checks in the "&&" expression, so that the short-circuit evaluation prevents out-of-bounds array accesses. Signed-off-by: Mario Six <mario.six@gdsys.cc> Signed-off-by: Stefan Roese <sr@denx.de>