mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
UPSTREAM: cbfstool: Fix off-by-one error in checking hash_type
BUG=None BRANCH=None TEST=None Found-by: Coverity Scan #1325836 Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://review.coreboot.org/17698 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org> Change-Id: Iaf208705d0cd450288af721d53053b2d3407a336 Reviewed-on: https://chromium-review.googlesource.com/416261 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
194fa904d6
commit
2199d415a7
1 changed files with 1 additions and 1 deletions
|
@ -1399,7 +1399,7 @@ int cbfs_print_entry_info(struct cbfs_image *image, struct cbfs_file *entry,
|
||||||
struct cbfs_file_attr_hash *hash = NULL;
|
struct cbfs_file_attr_hash *hash = NULL;
|
||||||
while ((hash = cbfs_file_get_next_hash(entry, hash)) != NULL) {
|
while ((hash = cbfs_file_get_next_hash(entry, hash)) != NULL) {
|
||||||
unsigned int hash_type = ntohl(hash->hash_type);
|
unsigned int hash_type = ntohl(hash->hash_type);
|
||||||
if (hash_type > CBFS_NUM_SUPPORTED_HASHES) {
|
if (hash_type >= CBFS_NUM_SUPPORTED_HASHES) {
|
||||||
fprintf(fp, "invalid hash type %d\n", hash_type);
|
fprintf(fp, "invalid hash type %d\n", hash_type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue