summaryrefslogtreecommitdiff
path: root/host
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2018-03-11 09:56:06 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-03-11 17:56:29 -0700
commit4c84e077858c809ee80a9a6f9b38185cf7dcded7 (patch)
tree72e2c9c58aa9063085a6e70bf36589e5e6183f04 /host
parent0bdb8713be40abfe963d9ef625dbb67961068840 (diff)
downloadvboot-4c84e077858c809ee80a9a6f9b38185cf7dcded7.tar.gz
crossystem: Fix mosys data length check
CL:942031 introduced a check for the length of output returned by mosys. If the output has a trailing newline, then the check failed. Just make sure we get at least as much data as we expect. BUG=b:74439800 BRANCH=none TEST=run crossystem on bob; no 'mosys returned hex data' errors Change-Id: If678b201185dbda869e4e17abae314470f5cef4a Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/958286 Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Diffstat (limited to 'host')
-rw-r--r--host/lib/crossystem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c
index 148e793e..f379d228 100644
--- a/host/lib/crossystem.c
+++ b/host/lib/crossystem.c
@@ -861,9 +861,9 @@ int vb2_read_nv_storage_mosys(struct vb2_context *ctx)
if (ExecuteMosys(argv, hexstring, sizeof(hexstring)))
return -1;
- if (strlen(hexstring) != 2 * nvsize) {
+ if (strlen(hexstring) < 2 * nvsize) {
fprintf(stderr, "mosys returned hex nvdata size %d"
- " (expected %d)\n", (int)strlen(hexstring), 2 * nvsize);
+ " (need %d)\n", (int)strlen(hexstring), 2 * nvsize);
return -1;
}
hexdigit[2] = '\0';