Skip to content

Commit

Permalink
fs/fcb: Fix fcb_walk local variable initialization
Browse files Browse the repository at this point in the history
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 <jerzy.kasenberg@codecoup.pl>
  • Loading branch information
kasjer committed Sep 10, 2024
1 parent 74ea30f commit 2fdc30a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/fcb/src/fcb_walk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 2fdc30a

Please sign in to comment.