diff options
author | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2013-09-23 14:21:06 +0000 |
---|---|---|
committer | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2013-09-23 14:21:06 +0000 |
commit | dc018d563fc4e333151b899d6bbf1ccd0ffdcbed (patch) | |
tree | 4a5f50d844a729a5806abfed35e79169ca9fd6d2 /cli_classic.c | |
parent | 0a6d007bbdac28911cd4b22c6c131891df5d1ccb (diff) | |
download | flashrom-dc018d563fc4e333151b899d6bbf1ccd0ffdcbed.tar.gz |
layout: Verify layout entries before building a new image using them.
This fixes a SEGFAULT if a layout entry is included that addresses memory
outside the current chip's address range. flashrom will only abort if the
offending region(s) is/are included else it will just warn.
It will print warnings for regions with negative or zero-length address ranges
and bail out after checking all of them.
Also, abort for non-write operations if a layout file is given because there is
no layout support for other operations yet.
Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1751 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'cli_classic.c')
-rw-r--r-- | cli_classic.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cli_classic.c b/cli_classic.c index 70bccb5..a0c2d64 100644 --- a/cli_classic.c +++ b/cli_classic.c @@ -370,6 +370,12 @@ int main(int argc, char *argv[]) ret = 1; goto out; } + if (layoutfile != NULL && !write_it) { + msg_gerr("Layout files are currently supported for write operations only.\n"); + ret = 1; + goto out; + } + if (process_include_args()) { ret = 1; goto out; |