From 897ea2e08b905b8b2feca060b6b64509ef6067ad Mon Sep 17 00:00:00 2001 From: Myles Watson Date: Thu, 21 Feb 2008 21:02:19 +0000 Subject: [PATCH] This is a pretty trivial patch that returns an error message when the file is not found instead of seg faulting. test with: lar -a coreboot.rom nonexistant_file.bin Signed-off-by: Myles Watson Acked-by: Ronald G. Minnich git-svn-id: svn://coreboot.org/repository/coreboot-v3@615 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- util/lar/stream.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/lar/stream.c b/util/lar/stream.c index fc6cc452bf..bb563aa389 100644 --- a/util/lar/stream.c +++ b/util/lar/stream.c @@ -946,6 +946,9 @@ int lar_add_file(struct lar *lar, char *name) ptr = mapfile(filename, &size); + if (ptr == MAP_FAILED) + return -1; + if (elfparse() && iself(ptr)) { output_elf_segments(lar, pathname, ptr, size, thisalgo); return 0;