summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2020-05-05 10:43:37 +0800
committerCommit Bot <commit-bot@chromium.org>2020-05-05 10:50:18 +0000
commitd72dd12f1dfc5d6682a59b19abc70d479a8b9275 (patch)
treee6987c9142bbb772f30d22d158150ae1aefe0e2e
parentc909976b558f1a357b29916849c1a9d678e1bdbd (diff)
downloadvboot-d72dd12f1dfc5d6682a59b19abc70d479a8b9275.tar.gz
vboot/ui: initialize vb2_ui_context memory to 0
Members of vb2_ui_context are undefined unless initialized. memset() the entire struct to 0 initially. BUG=b:146399181 TEST=make clean && make runtests BRANCH=none Change-Id: Ieeb77c576231c4a4afb204e47983e35916be8fe4 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2182082 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
-rw-r--r--firmware/2lib/2ui.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/firmware/2lib/2ui.c b/firmware/2lib/2ui.c
index eab7c58d..10f51d6a 100644
--- a/firmware/2lib/2ui.c
+++ b/firmware/2lib/2ui.c
@@ -223,6 +223,7 @@ vb2_error_t ui_loop(struct vb2_context *ctx, enum vb2_screen root_screen_id,
vb2_error_t (*action)(struct vb2_ui_context *ui);
vb2_error_t rv;
+ memset(&ui, 0, sizeof(ui));
ui.ctx = ctx;
ui.root_screen = vb2_get_screen_info(root_screen_id);
if (ui.root_screen == NULL)