[libgit2-glib] Set correct native when setting email options author
- From: Ernestas Kulik <ernestask src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib] Set correct native when setting email options author
- Date: Sat, 6 May 2017 18:18:26 +0000 (UTC)
commit 0e1e1bc77190e565032139fe9617387d25f33498
Author: Ernestas Kulik <ernestask gnome org>
Date: Sat May 6 13:45:53 2017 +0300
Set correct native when setting email options author
When setting the author for email options, the code makes a copy of the
signature parameter, but takes the native of the original object, which
can result in use-after-free when the original object is destroyed.
https://bugzilla.gnome.org/show_bug.cgi?id=777932
libgit2-glib/ggit-diff-format-email-options.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/libgit2-glib/ggit-diff-format-email-options.c b/libgit2-glib/ggit-diff-format-email-options.c
index 96f824a..63e3a03 100644
--- a/libgit2-glib/ggit-diff-format-email-options.c
+++ b/libgit2-glib/ggit-diff-format-email-options.c
@@ -536,7 +536,7 @@ ggit_diff_format_email_options_set_author (GgitDiffFormatEmailOptions *options,
if (author)
{
priv->author = ggit_signature_copy (author);
- priv->options.author = _ggit_native_get (author);
+ priv->options.author = _ggit_native_get (priv->author);
}
g_object_notify (G_OBJECT (options), "author");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]