diff options
author | Patrick Georgi <pgeorgi@chromium.org> | 2017-01-13 13:30:54 +0100 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2017-03-20 20:05:09 +0100 |
commit | dce629b2f8260010a06ea5a9bd31f5c65f483f3d (patch) | |
tree | e115338fc2b00d1c9820414afd33e2bb8608fd34 /util/cbfstool/fmd.c | |
parent | 1dfc0a64d42cc9052f5140cfa481ec0380971eef (diff) |
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>
Diffstat (limited to 'util/cbfstool/fmd.c')
-rw-r--r-- | util/cbfstool/fmd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/util/cbfstool/fmd.c b/util/cbfstool/fmd.c index afd87015f8..7a289d7743 100644 --- a/util/cbfstool/fmd.c +++ b/util/cbfstool/fmd.c @@ -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) |