From 1eacd5fe2e3cd7b0c8a8e61e66389af701036dda Mon Sep 17 00:00:00 2001 From: Jerzy Kasenberg Date: Wed, 7 Aug 2024 13:25:35 +0200 Subject: [PATCH] fs/fcb: Fix fcb_walk local variable initialization fcb_walk initialize only certain fields of fcb_entry before walking. This could lead to unpredictable behaviour if additional fields were utilized. Signed-off-by: Jerzy Kasenberg --- fs/fcb/src/fcb_walk.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/fcb/src/fcb_walk.c b/fs/fcb/src/fcb_walk.c index b3e61fde65..9daf55f231 100644 --- a/fs/fcb/src/fcb_walk.c +++ b/fs/fcb/src/fcb_walk.c @@ -27,11 +27,10 @@ int fcb_walk(struct fcb *fcb, struct flash_area *fap, fcb_walk_cb cb, void *cb_arg) { - struct fcb_entry loc; + struct fcb_entry loc = {0}; int rc; loc.fe_area = fap; - loc.fe_elem_off = 0; rc = os_mutex_pend(&fcb->f_mtx, OS_WAIT_FOREVER); if (rc && rc != OS_NOT_STARTED) {