This commit is contained in:
Matěj Grabovský 2020-10-09 10:30:49 +02:00
parent 11466005e0
commit aa4f8872d7
2 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,34 @@
From 9b6d40905c21b476c58e9f9a908ddb32a0a56a18 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mat=C4=9Bj=20Grabovsk=C3=BD?= <mgrabovs@redhat.com>
Date: Tue, 29 Sep 2020 19:14:05 +0200
Subject: [PATCH] gui-wizard-gtk: Don't autofree URL string
g_object_set_data() does not (and cannot) copy the data passed to it, so
once url is freed, a subsequent access to the 'url' tag leads to an
invalid read and segfault.
Bug was introduced in df386b097.
Resolves rhbz#1882328
---
src/gui-wizard-gtk/wizard.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
index 0af19587..ba1998df 100644
--- a/src/gui-wizard-gtk/wizard.c
+++ b/src/gui-wizard-gtk/wizard.c
@@ -462,8 +462,8 @@ static void append_to_textview(GtkTextView *tv, const char *str)
GtkTextTag *tag;
tag = gtk_text_buffer_create_tag(tb, NULL, "foreground", "blue",
"underline", PANGO_UNDERLINE_SINGLE, NULL);
- g_autofree char *url = g_strndup(t->start, t->len);
- g_object_set_data(G_OBJECT(tag), "url", url);
+ char *url = g_strndup(t->start, t->len);
+ g_object_set_data_full(G_OBJECT(tag), "url", url, g_free);
gtk_text_buffer_insert_with_tags(tb, &text_iter, url, -1, tag, NULL);
--
2.26.2

View File

@ -15,7 +15,7 @@
Summary: Generic library for reporting various problems
Name: libreport
Version: 2.14.0
Release: 10%{?dist}
Release: 11%{?dist}
License: GPLv2+
URL: https://abrt.readthedocs.org/
Source: https://github.com/abrt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
@ -26,6 +26,7 @@ Patch2: 0003-gui-wizard-gtk-Fix-a-double-free-condition.patch
Patch3: 0004-gui-wizard-gtk-Fix-a-segfault-and-memory-leak.patch
Patch4: 0005-gui-wizard-gtk-Fix-segfault.patch
Patch5: 0006-event_config-Null-autofree-pointers-before-returning.patch
Patch6: 0007-gui-wizard-gtk-Don-t-autofree-URL-string.patch
BuildRequires: %{dbus_devel}
BuildRequires: gtk3-devel
@ -666,6 +667,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%endif
%changelog
* Fri Oct 09 2020 Matěj Grabovský <mgrabovs@redhat.com> - 2.14.0-11
- Add fix for https://bugzilla.redhat.com/show_bug.cgi?id=1882328
* Tue Sep 29 2020 Matěj Grabovský <mgrabovs@redhat.com> - 2.14.0-10
- Add fix for https://bugzilla.redhat.com/show_bug.cgi?id=1883337
- Add fix for https://bugzilla.redhat.com/show_bug.cgi?id=1883410