[coreboot-gerrit] New patch to review for coreboot: fmaptool: Make sure strings are not destroyed on hdestroy()

Stefan Reinauer (stefan.reinauer@coreboot.org) gerrit at coreboot.org
Thu Apr 21 07:14:38 CEST 2016


Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14443

-gerrit

commit 3e08e4e82c6d832da0ed862ce6936e0022e61196
Author: Stefan Reinauer <stefan.reinauer at coreboot.org>
Date:   Wed Apr 20 22:11:25 2016 -0700

    fmaptool: Make sure strings are not destroyed on hdestroy()
    
    On Mac OS X hdestroy seems to overwrite node->name. Hence
    duplicate the string before stuffing it into the hash search
    table.
    
    Change-Id: Ieac2025f5c960cdb8d509dde7e92ba0dd32644b0
    Signed-off-by: Stefan Reinauer <stefan.reinauer at coreboot.org>
---
 util/cbfstool/fmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/cbfstool/fmd.c b/util/cbfstool/fmd.c
index a11b7f0..a485d23 100644
--- a/util/cbfstool/fmd.c
+++ b/util/cbfstool/fmd.c
@@ -51,7 +51,7 @@ static bool validate_descriptor_node(const struct flashmap_descriptor *node,
 		struct unsigned_option start, struct unsigned_option end) {
 	assert(node);
 
-	ENTRY search_key = {node->name, NULL};
+	ENTRY search_key = {strdup(node->name), NULL};
 	if (hsearch(search_key, FIND)) {
 		ERROR("Multiple sections with name '%s'\n", node->name);
 		return false;



More information about the coreboot-gerrit mailing list