From 8628d5e1f11da32a9f3f00240c039721254e08d1 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Fri, 12 Apr 2019 08:41:42 -0500 Subject: [PATCH] Fixed buffer overflow due to mistaking prog_size for cache_size found by ajaybhargav --- lfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lfs.c b/lfs.c index 7c51117..e39e95b 100644 --- a/lfs.c +++ b/lfs.c @@ -29,7 +29,7 @@ static inline void lfs_cache_drop(lfs_t *lfs, lfs_cache_t *rcache) { static inline void lfs_cache_zero(lfs_t *lfs, lfs_cache_t *pcache) { // zero to avoid information leak - memset(pcache->buffer, 0xff, lfs->cfg->prog_size); + memset(pcache->buffer, 0xff, lfs->cfg->cache_size); pcache->block = 0xffffffff; }