[coreboot-gerrit] New patch to review for coreboot: util/cbfstool: check that buffer_create worked

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Wed Dec 14 16:13:24 CET 2016


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17860

-gerrit

commit bbca52e975ae6347aa44d125b29df80a4ac6d70f
Author: Patrick Georgi <pgeorgi at chromium.org>
Date:   Wed Dec 14 16:11:58 2016 +0100

    util/cbfstool: check that buffer_create worked
    
    We might not care much about this buffer, but we really use it later
    on...
    
    Change-Id: Ia16270f836d05d8b454e77de7b5babeb6bb05d6d
    Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
    Found-by: Coverity Scan #1294797
---
 util/cbfstool/cbfstool.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c
index 7a71427..d3c15e0 100644
--- a/util/cbfstool/cbfstool.c
+++ b/util/cbfstool/cbfstool.c
@@ -776,7 +776,8 @@ static int cbfs_create(void)
 	struct buffer bootblock;
 	if (!param.bootblock) {
 		DEBUG("-B not given, creating image without bootblock.\n");
-		buffer_create(&bootblock, 0, "(dummy)");
+		if (buffer_create(&bootblock, 0, "(dummy)") != 0)
+			return 1;
 	} else if (buffer_from_file(&bootblock, param.bootblock)) {
 		return 1;
 	}



More information about the coreboot-gerrit mailing list