|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From 48d4c7468fb5003ae45ac834de1ca85624cdd56e Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: Philippe De Swert <philippedeswert@gmail.com>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Wed, 10 Sep 2014 12:20:39 +0300
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] journal: do not dereference already freed patterns
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
In case set_consume goes wrong, the pattern name has already been
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
freed. So we do not try to print it in the logs, assuming the pattern
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
addition print will be printed just before the failure anyway. Found
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
with coverity. Fixes: CID#1237798
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/journal/coredumpctl.c | 3 +--
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 1 insertion(+), 2 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index f5cf85a765..34dcae87c0 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/journal/coredumpctl.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/journal/coredumpctl.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -110,8 +110,7 @@ static int add_match(Set *set, const char *match) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
log_debug("Adding pattern: %s", pattern);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
r = set_consume(set, pattern);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
if (r < 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- log_error("Failed to add pattern '%s': %s",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- pattern, strerror(-r));
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ log_error("Failed to add pattern: %s", strerror(-r));
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
goto fail;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|