From: Karel Zak Date: Wed, 12 Mar 2025 14:16:18 +0000 (+0100) Subject: lsfd: initialize struct stat [coverity scan] X-Git-Tag: v2.41~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b00042008d5be154ab669af0804797c3819b86ab;p=thirdparty%2Futil-linux.git lsfd: initialize struct stat [coverity scan] It's probably unnecessary, but for a complicated function, it's probably better just to keep the static analyzer happy. Signed-off-by: Karel Zak (cherry picked from commit e05e2b4f89a00fadc1032ad7720fefdd99dca029) --- diff --git a/lsfd-cmd/lsfd.c b/lsfd-cmd/lsfd.c index 41abeb204..66c60a4e8 100644 --- a/lsfd-cmd/lsfd.c +++ b/lsfd-cmd/lsfd.c @@ -872,7 +872,7 @@ static struct file *collect_file_symlink(struct path_cxt *pc, bool sockets_only) { char sym[PATH_MAX] = { '\0' }; - struct stat sb; + struct stat sb = { .st_mode = 0 }; struct file *f, *prev; if (ul_path_readlink(pc, sym, sizeof(sym), name) < 0) @@ -963,7 +963,7 @@ static void parse_maps_line(struct path_cxt *pc, char *buf, struct proc *proc) uint64_t start, end, offset, ino; unsigned long major, minor; enum association assoc = ASSOC_MEM; - struct stat sb; + struct stat sb = { .st_mode = 0 }; struct file *f, *prev; char *path, modestr[5]; dev_t devno;