[gnome-calendar/mcatanzaro/#435: 29/29] Fix use-after-free in GcalManager code
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/mcatanzaro/#435: 29/29] Fix use-after-free in GcalManager code
- Date: Tue, 3 Sep 2019 12:07:40 +0000 (UTC)
commit 5d2c0faf4128858cb6d207d5bc93dd247e660401
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Wed Jul 17 17:52:39 2019 -0500
Fix use-after-free in GcalManager code
This was originally discovered and fixed by Milan Crha; I'm just
forward-porting his fix to the master branch. self->clients takes
ownership of this source but we don't currently have ownership here,
leading to a double free vulnerability.
Fixes #435
src/core/gcal-manager.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/core/gcal-manager.c b/src/core/gcal-manager.c
index f527e912..3b073581 100644
--- a/src/core/gcal-manager.c
+++ b/src/core/gcal-manager.c
@@ -269,7 +269,7 @@ on_calendar_created_cb (GObject *source_object,
client = gcal_calendar_get_client (calendar);
source = gcal_calendar_get_source (calendar);
- g_hash_table_insert (self->clients, source, calendar);
+ g_hash_table_insert (self->clients, g_object_ref (source), calendar);
if (visible)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]