[ostree] Fix use of uninitialized memory in ostree_builtin_checksum()



commit 349d7958f35fc04642a5be224ca36e6c6bc5b8ed
Author: Stef Walter <stefw redhat com>
Date:   Wed Aug 14 10:20:41 2013 +0200

    Fix use of uninitialized memory in ostree_builtin_checksum()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=705968

 src/ostree/ot-builtin-checksum.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/ostree/ot-builtin-checksum.c b/src/ostree/ot-builtin-checksum.c
index aa82a97..999bdd2 100644
--- a/src/ostree/ot-builtin-checksum.c
+++ b/src/ostree/ot-builtin-checksum.c
@@ -26,6 +26,8 @@
 #include "ostree.h"
 #include "libgsystem.h"
 
+#include <string.h>
+
 static GOptionEntry options[] = {
   { NULL }
 };
@@ -61,6 +63,8 @@ ostree_builtin_checksum (int argc, char **argv, GFile *repo_path_path, GCancella
   gs_unref_object GFile *f = NULL;
   AsyncChecksumData data;
 
+  memset (&data, 0, sizeof (data));
+
   context = g_option_context_new ("FILENAME - Checksum a file or directory");
   g_option_context_add_main_entries (context, options, NULL);
 


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