Blame SOURCES/0061-dbus-fixed-abrt-dbus-memory-leaks.patch

06486d
From ca9e26aab4b78dbd0d5f59ca5e3bda47000b6353 Mon Sep 17 00:00:00 2001
06486d
From: Matej Habrnal <mhabrnal@redhat.com>
06486d
Date: Thu, 18 Sep 2014 15:02:01 +0200
06486d
Subject: [ABRT PATCH 61/66] dbus: fixed abrt-dbus memory leaks
06486d
06486d
Fixed memory leaks in abrt-dbus (method FindProblemByElementInTimeRange).
06486d
This method leaks memory if fuzzing on org.freedesktop.problems interface.
06486d
06486d
Related to rhbz#1015473
06486d
06486d
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
06486d
---
06486d
 src/dbus/abrt-dbus.c | 18 +++++++++++-------
06486d
 1 file changed, 11 insertions(+), 7 deletions(-)
06486d
06486d
diff --git a/src/dbus/abrt-dbus.c b/src/dbus/abrt-dbus.c
06486d
index 0350dee..308a9af 100644
06486d
--- a/src/dbus/abrt-dbus.c
06486d
+++ b/src/dbus/abrt-dbus.c
06486d
@@ -685,13 +685,17 @@ static void handle_method_call(GDBusConnection *connection,
06486d
 
06486d
     if (g_strcmp0(method_name, "FindProblemByElementInTimeRange") == 0)
06486d
     {
06486d
-        const char *element;
06486d
-        const char *value;
06486d
-        long timestamp_from;
06486d
-        long timestamp_to;
06486d
-        bool all;
06486d
-
06486d
-        g_variant_get(parameters, "(ssxxb)", &element, &value, &timestamp_from, &timestamp_to, &all;;
06486d
+        const gchar *element;
06486d
+        const gchar *value;
06486d
+        glong timestamp_from;
06486d
+        glong timestamp_to;
06486d
+        gboolean all;
06486d
+
06486d
+        g_variant_get_child(parameters, 0, "&s", &element);
06486d
+        g_variant_get_child(parameters, 1, "&s", &value);
06486d
+        g_variant_get_child(parameters, 2, "x", &timestamp_from);
06486d
+        g_variant_get_child(parameters, 3, "x", &timestamp_to);
06486d
+        g_variant_get_child(parameters, 4, "b", &all;;
06486d
 
06486d
         if (all && polkit_check_authorization_dname(caller, "org.freedesktop.problems.getall") == PolkitYes)
06486d
             caller_uid = 0;
06486d
-- 
06486d
1.8.3.1
06486d