Browse Source

!561 修复cat命令因为类型转换可能导致的存在的数组越界问题
Merge pull request !561 from sliver/fix_bug_cat

bernard 3 years ago
parent
commit
6662b0c289
1 changed files with 1 additions and 1 deletions
  1. 1 1
      components/dfs/src/dfs_file.c

+ 1 - 1
components/dfs/src/dfs_file.c

@@ -834,7 +834,7 @@ FINSH_FUNCTION_EXPORT(rm, remove files or directories);
 void cat(const char *filename)
 {
     struct dfs_fd fd;
-    uint32_t length = 0;
+    int length = 0;
     char buffer[81];
 
     fd_init(&fd);