[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20190829053528.15702-1-yzhai003@ucr.edu>
Date: Wed, 28 Aug 2019 22:35:28 -0700
From: Yizhuo <yzhai003@....edu>
To: unlisted-recipients:; (no To-header on input)
Cc: csong@...ucr.edu, zhiyunq@...ucr.edu, Yizhuo <yzhai003@....edu>,
linux-kernel@...r.kernel.org
Subject: [PATCH] adfs: obj.file_id is uninitialized if __adfs_dir_get() returns error code
Inside function adfs_dir_find_entry(), obj.file_id could be uninitialized
if __adfs_dir_get() returns error code. However, the return check cannot
promise the initialization of obj.file_id, which is used in the if
statement. This is potentially unsafe.
Signed-off-by: Yizhuo <yzhai003@....edu>
---
fs/adfs/dir_f.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/adfs/dir_f.c b/fs/adfs/dir_f.c
index 0fbfd0b04ae0..d7fc47598e78 100644
--- a/fs/adfs/dir_f.c
+++ b/fs/adfs/dir_f.c
@@ -335,7 +335,7 @@ adfs_dir_find_entry(struct adfs_dir *dir, unsigned long object_id)
ret = -ENOENT;
for (pos = 5; pos < ADFS_NUM_DIR_ENTRIES * 26 + 5; pos += 26) {
- struct object_info obj;
+ struct object_info obj = {};
if (!__adfs_dir_get(dir, pos, &obj))
break;
--
2.17.1
Powered by blists - more mailing lists