From 9af63b3844434b9c77b1d52af1ab0e2df3be42cc Mon Sep 17 00:00:00 2001 From: Jan Boon Date: Sat, 9 Jul 2022 17:17:25 +0800 Subject: [PATCH] Fix buffer overflow in tests when using a large block size --- scripts/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test.py b/scripts/test.py index 92a13b1d..c8196b36 100755 --- a/scripts/test.py +++ b/scripts/test.py @@ -93,7 +93,7 @@ PROLOGUE = """ __attribute__((unused)) lfs_dir_t dir; __attribute__((unused)) struct lfs_info info; __attribute__((unused)) char path[1024]; - __attribute__((unused)) uint8_t buffer[1024]; + __attribute__((unused)) uint8_t buffer[(1024 > LFS_BLOCK_SIZE * 4) ? (1024) : (LFS_BLOCK_SIZE * 4)]; __attribute__((unused)) lfs_size_t size; __attribute__((unused)) int err;