From 8b75de74c916ed516c634388f81c1bbcac446d41 Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Tue, 12 Aug 2025 17:03:40 +0200 Subject: [PATCH] fix: add missing return causing uninitialized reads If lfs_bd_read fails, lfs_fcrc_fromle32 will read uninitialized memory, and hasfcrc will be set to true. This may end up in a "working" state later due to crcs not matching. but it's hard to follow if that woud be the case. --- lfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lfs.c b/lfs.c index 624f43cc..49aa1215 100644 --- a/lfs.c +++ b/lfs.c @@ -1279,6 +1279,7 @@ static lfs_stag_t lfs_dir_fetchmatch(lfs_t *lfs, if (err == LFS_ERR_CORRUPT) { break; } + return err; } lfs_fcrc_fromle32(&fcrc);