Skip to content

Commit 17ab6e9

Browse files
authored
Merge pull request #1133 from elupus/patch-1
fix: false uninitialized read warning
2 parents 8e251dd + 11cecd0 commit 17ab6e9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lfs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ static int lfs_bd_read(lfs_t *lfs,
9393
// bypass cache?
9494
diff = lfs_aligndown(diff, lfs->cfg->read_size);
9595
int err = lfs->cfg->read(lfs->cfg, block, off, data, diff);
96+
LFS_ASSERT(err <= 0);
9697
if (err) {
9798
return err;
9899
}
@@ -739,6 +740,7 @@ static lfs_stag_t lfs_dir_getslice(lfs_t *lfs, const lfs_mdir_t *dir,
739740
int err = lfs_bd_read(lfs,
740741
NULL, &lfs->rcache, sizeof(ntag),
741742
dir->pair[0], off, &ntag, sizeof(ntag));
743+
LFS_ASSERT(err <= 0);
742744
if (err) {
743745
return err;
744746
}
@@ -767,6 +769,7 @@ static lfs_stag_t lfs_dir_getslice(lfs_t *lfs, const lfs_mdir_t *dir,
767769
err = lfs_bd_read(lfs,
768770
NULL, &lfs->rcache, diff,
769771
dir->pair[0], off+sizeof(tag)+goff, gbuffer, diff);
772+
LFS_ASSERT(err <= 0);
770773
if (err) {
771774
return err;
772775
}

0 commit comments

Comments
 (0)