summaryrefslogtreecommitdiff
path: root/payloads/libpayload/libcbfs/cbfs.c
diff options
context:
space:
mode:
authorYu-Ping Wu <yupingso@chromium.org>2022-06-15 15:03:04 +0800
committerJulius Werner <jwerner@chromium.org>2022-06-16 18:02:34 +0000
commitc1d7d89d48c536773b4f7f5e84da907fe635a256 (patch)
treed61414372a20c02b530ab96eee60aa1a0e2ce211 /payloads/libpayload/libcbfs/cbfs.c
parente3fded324135e214a777073a5eb326087bcc2fae (diff)
libpayload/libcbfs: Fix file hash check
Fix the buffer pointer passed to cbfs_file_hash_mismatch(). Add a test case with LZ4 compression, which would catch the bug we are fixing. Change-Id: I36605e2dbc0423fa6743087512f2042b37c49d35 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/65149 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'payloads/libpayload/libcbfs/cbfs.c')
-rw-r--r--payloads/libpayload/libcbfs/cbfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/payloads/libpayload/libcbfs/cbfs.c b/payloads/libpayload/libcbfs/cbfs.c
index ff191799a4..0694c4f7c5 100644
--- a/payloads/libpayload/libcbfs/cbfs.c
+++ b/payloads/libpayload/libcbfs/cbfs.c
@@ -120,7 +120,7 @@ static size_t cbfs_load_and_decompress(size_t offset, size_t in_size, void *buff
goto out;
}
- if (cbfs_file_hash_mismatch(buffer, in_size, mdata, skip_verification))
+ if (cbfs_file_hash_mismatch(load, in_size, mdata, skip_verification))
goto out;
switch (compression) {