[libgit2-glib] Always initialize CallbackWrapperData with zeroes
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib] Always initialize CallbackWrapperData with zeroes
- Date: Wed, 17 Aug 2016 12:55:21 +0000 (UTC)
commit 7af64b245e9806e6c2ba319ca30f41ec47139e00
Author: Christian Hergert <chergert redhat com>
Date: Wed Aug 17 14:55:11 2016 +0200
Always initialize CallbackWrapperData with zeroes
This was causing a crash due to invalid pointers in the structure. This
fixes that by simply starting from a zeroed structure.
https://bugzilla.gnome.org/show_bug.cgi?id=770028
libgit2-glib/ggit-diff.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/libgit2-glib/ggit-diff.c b/libgit2-glib/ggit-diff.c
index c7e9707..724c134 100644
--- a/libgit2-glib/ggit-diff.c
+++ b/libgit2-glib/ggit-diff.c
@@ -596,7 +596,7 @@ ggit_diff_foreach (GgitDiff *diff,
GError **error)
{
gint ret;
- CallbackWrapperData wrapper_data;
+ CallbackWrapperData wrapper_data = { 0 };
git_diff_file_cb real_file_cb = NULL;
git_diff_binary_cb real_binary_cb = NULL;
git_diff_hunk_cb real_hunk_cb = NULL;
@@ -669,7 +669,7 @@ ggit_diff_print (GgitDiff *diff,
GError **error)
{
gint ret;
- CallbackWrapperData wrapper_data;
+ CallbackWrapperData wrapper_data = { 0 };
g_return_if_fail (GGIT_IS_DIFF (diff));
g_return_if_fail (print_cb != NULL);
@@ -813,7 +813,7 @@ ggit_diff_blobs (GgitBlob *old_blob,
{
gint ret;
const git_diff_options *gdiff_options;
- CallbackWrapperData wrapper_data;
+ CallbackWrapperData wrapper_data = { 0 };
git_diff_file_cb real_file_cb = NULL;
git_diff_binary_cb real_binary_cb = NULL;
git_diff_hunk_cb real_hunk_cb = NULL;
@@ -903,7 +903,7 @@ ggit_diff_blob_to_buffer (GgitBlob *old_blob,
{
gint ret;
const git_diff_options *gdiff_options;
- CallbackWrapperData wrapper_data;
+ CallbackWrapperData wrapper_data = { 0 };
git_diff_file_cb real_file_cb = NULL;
git_diff_binary_cb real_binary_cb = NULL;
git_diff_hunk_cb real_hunk_cb = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]