xdg-autostart: fix two coverity found issues

Fixes: CID#1429003
Fixes: CID#1429004
This commit is contained in:
Lennart Poettering 2020-05-28 23:34:24 +02:00
parent 871dc8d644
commit 6527b019fc
2 changed files with 2 additions and 4 deletions

View 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;
}

View 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;
}