Ticket #4103: mc-4103-cid-extfs.c-fix-uninitialized-scalar-variable.patch

File mc-4103-cid-extfs.c-fix-uninitialized-scalar-variable.patch, 1.5 KB (added by and, 20 months ago)
  • src/vfs/extfs/extfs.c

    From fa74fd7afa5040e8694e106231fe6aeba64b06b5 Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Mon, 7 Dec 2020 12:42:26 +0000
    Subject: [PATCH] (extfs.c) fix uninitialized scalar variable
    
    Fix uninitialized scalar variable
    
    Found by Coverity
    
    coverity id #32627
    coverity id #313665
    covertiy id #313669
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     src/vfs/extfs/extfs.c | 4 ++++
     1 file changed, 4 insertions(+)
    
    diff --git a/src/vfs/extfs/extfs.c b/src/vfs/extfs/extfs.c
    index 7ddbc7a80..da263b004 100644
    a b extfs_generate_entry (struct extfs_super_t *archive, const char *name, struct vf 
    200200    struct vfs_s_inode *inode; 
    201201    struct vfs_s_entry *entry; 
    202202 
     203    memset(&st, 0, sizeof(struct stat)); 
    203204    st.st_ino = VFS_SUPER (archive)->ino_usage++; 
    204205    st.st_dev = archive->rdev; 
    205206    myumask = umask (022); 
    extfs_open_archive (int fstype, const char *name, struct extfs_super_t **pparc) 
    408409    vfs_path_t *local_name_vpath = NULL; 
    409410    vfs_path_t *name_vpath; 
    410411 
     412    memset(&mystat, 0, sizeof(struct stat)); 
     413 
    411414    name_vpath = vfs_path_from_str (name); 
    412415    info = &g_array_index (extfs_plugins, extfs_plugin_info_t, fstype); 
    413416 
    extfs_read_archive (FILE * extfsd, struct extfs_super_t *current_archive) 
    562565                else 
    563566                { 
    564567                    struct stat st; 
     568                    memset(&st, 0, sizeof(struct stat)); 
    565569 
    566570                    st.st_ino = super->ino_usage++; 
    567571                    st.st_nlink = 1;