From 7ccd9ce48e761b7614d29ff95ef97d0a7dc1d599 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Fri, 30 Jan 2015 23:45:49 -0800 Subject: futility: handle truncated BIOS images without segfault A truncated BIOS with an otherwise valid FMAP that now points way off the end of the file shouldn't cause coredumps. BUG=none BRANCH=ToT TEST=make runtests Change-Id: Idf96e1e6a381bf0fe0b1cb2d16e3dad39ce7a0dc Signed-off-by: Bill Richardson Reviewed-on: https://chromium-review.googlesource.com/245500 Reviewed-by: Randall Spangler --- tests/futility/test_dump_fmap.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') diff --git a/tests/futility/test_dump_fmap.sh b/tests/futility/test_dump_fmap.sh index 142a1540..bcdb27e6 100755 --- a/tests/futility/test_dump_fmap.sh +++ b/tests/futility/test_dump_fmap.sh @@ -24,6 +24,9 @@ cmp "${SCRIPTDIR}/data_fmap_expect_h.txt" "$TMP" # contain the stuff that the FMAP claims it does. if "$FUTILITY" dump_fmap -x "${SCRIPTDIR}/data_fmap.bin" FMAP; then false; fi +# This should fail too +if "$FUTILITY" show "${SCRIPTDIR}/data_fmap.bin"; then false; fi + # However, this should work. "$FUTILITY" dump_fmap -x "${SCRIPTDIR}/data_fmap.bin" SI_DESC > "$TMP" cmp "${SCRIPTDIR}/data_fmap_expect_x.txt" "$TMP" -- cgit v1.2.1