浏览代码

Merge pull request #709 from BRTSG-FOSS/hotfix/tests-buffer-overflow

Fix buffer overflow in tests when using a large block size
Christopher Haster 3 年之前
父节点
当前提交
e683322af3
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scripts/test.py

+ 1 - 1
scripts/test.py

@@ -93,7 +93,7 @@ PROLOGUE = """
     __attribute__((unused)) lfs_dir_t dir;
     __attribute__((unused)) lfs_dir_t dir;
     __attribute__((unused)) struct lfs_info info;
     __attribute__((unused)) struct lfs_info info;
     __attribute__((unused)) char path[1024];
     __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)) lfs_size_t size;
     __attribute__((unused)) int err;
     __attribute__((unused)) int err;