diff options
author | Bill Richardson <wfrichar@chromium.org> | 2014-08-27 15:50:25 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-09-03 22:49:52 +0000 |
commit | cf6e78dbd54684ebba0c3bfc2524426f61193416 (patch) | |
tree | b8bab8d134c71546773befeb7fb4077341718c91 /host | |
parent | 487a54bcbe7b6dac1a856b0991e6d13c34a1c423 (diff) | |
download | vboot-cf6e78dbd54684ebba0c3bfc2524426f61193416.tar.gz |
futility: the show command can traverse all file types
It doesn't yet handle block devices, but it can display normal files
containing a entire BIOS image, a GBB, a VBLOCK, a .vbpubk, a .vblock,
and a firmware preamble (VbFirmwarePreambleHeader).
The command-line options are not well-documented.
BUG=chromium:224734
BRANCH=ToT
TEST=make runtests
Change-Id: I181f6331ae23599302bbaee3f270e8af9586cf06
Reviewed-on: https://chromium-review.googlesource.com/216032
Commit-Queue: Bill Richardson <wfrichar@chromium.org>
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/fmap.c | 5 | ||||
-rw-r--r-- | host/lib/include/host_key.h | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/host/lib/fmap.c b/host/lib/fmap.c index f9b0e5ed..76fa9f1d 100644 --- a/host/lib/fmap.c +++ b/host/lib/fmap.c @@ -14,7 +14,10 @@ FmapHeader *fmap_find(uint8_t *ptr, size_t size) { size_t i; FmapHeader *fmap_header; - for (i=0; i<size; i += FMAP_SEARCH_STRIDE, ptr += FMAP_SEARCH_STRIDE) { + size_t lim = size - sizeof(FmapHeader); + for (i = 0; + i <= lim; + i += FMAP_SEARCH_STRIDE, ptr += FMAP_SEARCH_STRIDE) { if (0 != memcmp(ptr, FMAP_SIGNATURE, FMAP_SIGNATURE_SIZE)) continue; fmap_header = (FmapHeader *)ptr; diff --git a/host/lib/include/host_key.h b/host/lib/include/host_key.h index 85aef244..9f98ccc3 100644 --- a/host/lib/include/host_key.h +++ b/host/lib/include/host_key.h @@ -9,7 +9,6 @@ #define VBOOT_REFERENCE_HOST_KEY_H_ #include "cryptolib.h" -#include "utility.h" #include "vboot_struct.h" |