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