Brad Bishop | 977dc1a | 2019-02-06 16:01:43 -0500 | [diff] [blame] | 1 | From bfc4183ea995f1c211385d066cdb1fe9ce89f621 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sun, 16 Dec 2018 20:53:38 -0800 |
| 4 | Subject: [PATCH 1/2] sysctl: Don't pass null directive argument to '%s' |
| 5 | |
| 6 | value pointer here is always NULL but subsequent use of that pointer |
| 7 | with a %s format will always be NULL, printing p instead would be a |
| 8 | valid string |
| 9 | |
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 11 | --- |
| 12 | Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/11179] |
| 13 | src/sysctl/sysctl.c | 2 +- |
| 14 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 15 | |
| 16 | diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c |
| 17 | index 1cfe51018..c67d79032 100644 |
| 18 | --- a/src/sysctl/sysctl.c |
| 19 | +++ b/src/sysctl/sysctl.c |
| 20 | @@ -115,7 +115,7 @@ static int parse_file(OrderedHashmap *sysctl_options, const char *path, bool ign |
| 21 | |
| 22 | value = strchr(p, '='); |
| 23 | if (!value) { |
| 24 | - log_error("Line is not an assignment at '%s:%u': %s", path, c, value); |
| 25 | + log_error("Line is not an assignment at '%s:%u': %s", path, c, p); |
| 26 | |
| 27 | if (r == 0) |
| 28 | r = -EINVAL; |
| 29 | -- |
| 30 | 2.20.1 |
| 31 | |