(backport) sysctl: Don't pass null directive argument to '%s'
authorKhem Raj <raj.khem@gmail.com>
Mon, 17 Dec 2018 04:53:38 +0000 (20:53 -0800)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Thu, 25 Jan 2024 10:55:12 +0000 (11:55 +0100)
value pointer here is always NULL but  subsequent use of that pointer
with a %s format will always be NULL, printing p instead would be a
valid string

Change-Id: Ib74f46d69eaf5e3d149523d53beef1f060a5fc16
Signed-off-by: Khem Raj <raj.khem@gmail.com>
src/sysctl/sysctl.c

index b3587e2..6f9b427 100644 (file)
@@ -127,7 +127,7 @@ static int parse_file(OrderedHashmap *sysctl_options, const char *path, bool ign
 
                 value = strchr(p, '=');
                 if (!value) {
-                        log_error("Line is not an assignment at '%s:%u': %s", path, c, value);
+                        log_error("Line is not an assignment at '%s:%u': %s", path, c, p);
 
                         if (r == 0)
                                 r = -EINVAL;