]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
xdg-autostart: fix two coverity found issues 15956/head
authorLennart Poettering <lennart@poettering.net>
Thu, 28 May 2020 21:34:24 +0000 (23:34 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 28 May 2020 21:38:38 +0000 (23:38 +0200)
Fixes: CID#1429003
Fixes: CID#1429004
src/fuzz/fuzz-xdg-desktop.c
src/xdg-autostart-generator/xdg-autostart-service.c

index 8c6472bee599843b3c342e4cd1ad1736fbd809ba..f8a1b5b28b23b9a85c6901c08f5a8493daff4a4f 100644 (file)
@@ -30,8 +30,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
 
         assert_se(service = xdg_autostart_service_parse_desktop(name));
         assert_se(service->name = strdup("fuzz-xdg-desktop.service"));
-        if (service)
-                (void) xdg_autostart_service_generate_unit(service, tmpdir);
+        (void) xdg_autostart_service_generate_unit(service, tmpdir);
 
         return 0;
 }
index 9ff80c5bb04f77107813f471d889517d1b3d60ca..c99b6cc8839c698c971a2ad5cea61e8fa5ae5013 100644 (file)
@@ -73,7 +73,6 @@ static int xdg_config_parse_bool(
                 void *userdata) {
 
         bool *b = data;
-        const char *value;
 
         assert(filename);
         assert(lvalue);
@@ -85,7 +84,7 @@ static int xdg_config_parse_bool(
         else if (streq(rvalue, "false"))
                 *b = false;
         else
-                return log_syntax(unit, LOG_ERR, filename, line, SYNTHETIC_ERRNO(EINVAL), "Invalid value for boolean: %s", value);
+                return log_syntax(unit, LOG_ERR, filename, line, SYNTHETIC_ERRNO(EINVAL), "Invalid value for boolean: %s", rvalue);
 
         return 0;
 }