Skip to content

Commit 8b75de7

Browse files
authored
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.
1 parent 8e251dd commit 8b75de7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,6 +1279,7 @@ static lfs_stag_t lfs_dir_fetchmatch(lfs_t *lfs,
12791279
if (err == LFS_ERR_CORRUPT) {
12801280
break;
12811281
}
1282+
return err;
12821283
}
12831284

12841285
lfs_fcrc_fromle32(&fcrc);

0 commit comments

Comments
 (0)