check for ELF payloads in cbfstool
Signed-off-by: Cristi Magherusan <cristi.magherusan@net.utcluj.ro>
Acked-by: Cristi Magherusan <cristi.magherusan@net.utcluj.ro>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4678 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
diff --git a/util/cbfstool/cbfs-mkpayload.c b/util/cbfstool/cbfs-mkpayload.c
index f8cc161..cdc5ffb 100644
--- a/util/cbfstool/cbfs-mkpayload.c
+++ b/util/cbfstool/cbfs-mkpayload.c
@@ -48,6 +48,12 @@
struct cbfs_payload_segment *segs;
int i;
+ if(!iself(input)){
+ printf("Fatal error: the payload file is not in ELF format!\n");
+ exit(1);
+ }
+
+
comp_func_ptr compress = compression_function(algo);
if (!compress)
return -1;