Fix uninitialized pointer read
authorJihoon Kim <jihoon48.kim@samsung.com>
Tue, 14 Jan 2025 00:25:55 +0000 (09:25 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 4 Feb 2025 10:05:20 +0000 (19:05 +0900)
scanf uses uninitialized value namelist when calling scandir.

Change-Id: Id5b651618477a76cefd6fca8c45c90124e825360
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/quirks.c

index bfe343bda858f9d24b9691a889599fe7311df526..fbeaedf8f83263645ca34e43eaf5bee28358e1f7 100644 (file)
@@ -1108,7 +1108,7 @@ is_data_file(const struct dirent *dir) {
 static inline bool
 parse_files(struct quirks_context *ctx, const char *data_path)
 {
-       struct dirent **namelist;
+       struct dirent **namelist = NULL;
        int ndev = -1;
        int idx = 0;