util/cbfstool: avoid memleaks and off-by-ones
Change-Id: Iac136a5dfe76f21aa7c0d5ee4e974e50b955403b Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Found-by: scan-build 3.8 Reviewed-on: https://review.coreboot.org/18134 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
committed by
Nico Huber
parent
1dfc0a64d4
commit
dce629b2f8
@@ -289,7 +289,7 @@ static void print_with_prefix(const struct flashmap_descriptor *tree,
|
||||
if (tree->list_len) {
|
||||
puts(":");
|
||||
|
||||
char child_prefix[strlen(pre) + 1];
|
||||
char child_prefix[strlen(pre) + 2];
|
||||
strcpy(child_prefix, pre);
|
||||
strcat(child_prefix, "\t");
|
||||
fmd_foreach_child(each, tree)
|
||||
|
Reference in New Issue
Block a user