[gnome-autoar/wip/oholy/covscan: 2/2] compressor: Fix usage of uninitialized value




commit e1c58e6d41ad15b3e3d691a92b033c3979a83274
Author: Ondrej Holy <oholy redhat com>
Date:   Tue May 11 10:08:54 2021 +0200

    compressor: Fix usage of uninitialized value
    
    The Coverity tool found usage of uninitialized value, which was unfortunatelly
    introduced by the recent commit c919227c. This might lead to segfaults when
    compressing remote files. Let's initialize the `sparse` variable to fix this.

 gnome-autoar/autoar-compressor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gnome-autoar/autoar-compressor.c b/gnome-autoar/autoar-compressor.c
index 908b3c2..31a5a58 100644
--- a/gnome-autoar/autoar-compressor.c
+++ b/gnome-autoar/autoar-compressor.c
@@ -963,7 +963,7 @@ autoar_compressor_do_add_to_archive (AutoarCompressor *self,
                        g_object_ref (file));
 
   {
-    struct archive_entry *sparse;
+    struct archive_entry *sparse = NULL;
 
      /* Hardlinks are handled in different ways by the archive formats. The
      * archive_entry_linkify function is a unified interface, which handling


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]