mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-01 14:11:15 +02:00
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. Corresponding to flashrom svn r1751. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user