forked from pool/systemd
1b6c230940
- Add analyze-fix-crash-in-command-line-parsing.patch: fix crash in systemd-analyze (bnc#859365) OBS-URL: https://build.opensuse.org/request/show/214486 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=489
36 lines
1.2 KiB
Diff
36 lines
1.2 KiB
Diff
From da6de8a55784115451582051c8da620056994a05 Mon Sep 17 00:00:00 2001
|
|
From: Frederic Crozat <fcrozat@suse.com>
|
|
Date: Mon, 20 Jan 2014 11:05:22 +0100
|
|
Subject: [PATCH] analyze: fix crash in command line parsing
|
|
|
|
Ensure DBusError is set before it can possibly be freed on return.
|
|
Fix crash when calling set-log-level without any parameter.
|
|
|
|
Fix https://bugzilla.novell.com/show_bug.cgi?id=859365
|
|
---
|
|
src/analyze/systemd-analyze.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/src/analyze/systemd-analyze.c b/src/analyze/systemd-analyze.c
|
|
index 27d063c..cdfae93 100644
|
|
--- a/src/analyze/systemd-analyze.c
|
|
+++ b/src/analyze/systemd-analyze.c
|
|
@@ -1226,13 +1226,13 @@ static int set_log_level(DBusConnection *bus, char **args) {
|
|
assert(bus);
|
|
assert(args);
|
|
|
|
+ dbus_error_init(&error);
|
|
if (strv_length(args) != 1) {
|
|
log_error("This command expects one argument only.");
|
|
return -E2BIG;
|
|
}
|
|
|
|
value = args[0];
|
|
- dbus_error_init(&error);
|
|
|
|
m = dbus_message_new_method_call("org.freedesktop.systemd1",
|
|
"/org/freedesktop/systemd1",
|
|
--
|
|
1.8.4
|
|
|