This repository has been archived on 2026-01-16. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
abrt-addon-python3/0061-dbus-fixed-abrt-dbus-memory-leaks.patch
Matej Habrnal 69165ba9cc Introduce abrt-addon-python3 package
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
2017-07-04 09:22:28 +02:00

47 lines
1.7 KiB
Diff

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