浏览代码

libfdt: Initialize the stack variable

Report Coverity log:
The code uses a variable that has not
been initialized, leading to unpredictable
or unintended results.

Reported-by: Coverity (CID: 60519)
Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
Tien Fong Chee 7 年之前
父节点
当前提交
18c991ca2b
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/libfdt/fdt_wip.c

+ 1 - 1
lib/libfdt/fdt_wip.c

@@ -115,7 +115,7 @@ int fdt_find_regions(const void *fdt, char * const inc[], int inc_count,
 		     struct fdt_region region[], int max_regions,
 		     char *path, int path_len, int add_string_tab)
 {
-	int stack[FDT_MAX_DEPTH];
+	int stack[FDT_MAX_DEPTH] = { 0 };
 	char *end;
 	int nextoffset = 0;
 	uint32_t tag;