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

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