The variables are error return parameters, i.e. only initialized on some errors,
not all. Let's hence always zero initialize them.
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
_cleanup_(sd_json_variant_unrefp) sd_json_variant *policy = NULL;
int r;
- unsigned line, column;
if (!arg_offline) {
r = acquire_bus(&bus, NULL);
pager_open(arg_pager_flags);
+ unsigned line = 0, column = 0;
if (arg_security_policy) {
r = sd_json_parse_file(/*f=*/ NULL, arg_security_policy, /*flags=*/ 0, &policy, &line, &column);
if (r < 0)
assert(ret);
if (arg_identity) {
- unsigned line, column;
+ unsigned line = 0, column = 0;
if (input)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Two identity records specified, refusing.");
assert(ret);
if (arg_identity) {
- unsigned line, column;
+ unsigned line = 0, column = 0;
sd_json_variant *un;
r = sd_json_parse_file(
_cleanup_close_ int fd = _fd; /* take possession, even on failure */
_cleanup_(user_record_unrefp) UserRecord *hr = NULL;
_cleanup_fclose_ FILE *f = NULL;
- unsigned line, column;
struct stat st;
int r;
rewind(f);
}
+ unsigned line = 0, column = 0;
r = sd_json_parse_file(f, "stdout", SD_JSON_PARSE_SENSITIVE, &v, &line, &column);
if (r < 0)
return log_error_errno(r, "Failed to parse identity at %u:%u: %m", line, column);
_cleanup_(sd_json_variant_unrefp) sd_json_variant *v = NULL;
_cleanup_(user_record_unrefp) UserRecord *hr = NULL;
- unsigned line, column;
int r, is_signed;
struct stat st;
Home *h;
if (st.st_size == 0)
goto unlink_this_file;
+ unsigned line = 0, column = 0;
r = sd_json_parse_file_at(NULL, dir_fd, fname, SD_JSON_PARSE_SENSITIVE, &v, &line, &column);
if (r < 0)
return log_error_errno(r, "Failed to parse identity record at %s:%u%u: %m", fname, line, column);
const char *text, *type;
crypt_token_info state;
sd_json_variant *jr, *jiv;
- unsigned line, column;
const EVP_CIPHER *cc;
state = sym_crypt_token_status(cd, token, &type);
if (r < 0)
return log_error_errno(r, "Failed to read LUKS token %i: %m", token);
+ unsigned line = 0, column = 0;
r = sd_json_parse(text, SD_JSON_PARSE_SENSITIVE, &v, &line, &column);
if (r < 0)
return log_error_errno(r, "Failed to parse LUKS token JSON data %u:%u: %m", line, column);
static int read_identity_file(int root_fd, sd_json_variant **ret) {
_cleanup_fclose_ FILE *identity_file = NULL;
_cleanup_close_ int identity_fd = -EBADF;
- unsigned line, column;
int r;
assert(root_fd >= 0);
if (!identity_file)
return log_oom();
+ unsigned line = 0, column = 0;
r = sd_json_parse_file(identity_file, ".identity", SD_JSON_PARSE_SENSITIVE, ret, &line, &column);
if (r < 0)
return log_error_errno(r, "[.identity:%u:%u] Failed to parse JSON data: %m", line, column);
_cleanup_(sd_json_variant_unrefp) sd_json_variant *v = NULL;
_cleanup_fclose_ FILE *opened_file = NULL;
_cleanup_hashmap_free_ Hashmap *blobs = NULL;
- unsigned line = 0, column = 0;
const char *json_path = NULL, *blob_filename;
FILE *json_file;
usec_t start;
json_file = stdin;
}
+ unsigned line = 0, column = 0;
r = sd_json_parse_file(json_file, json_path, SD_JSON_PARSE_SENSITIVE, &v, &line, &column);
if (r < 0)
return log_error_errno(r, "[%s:%u:%u] Failed to parse JSON data: %m", json_path, line, column);
return log_debug_errno(errno, "Failed to fdopen() serialization file descriptor: %m");
_cleanup_(sd_json_variant_unrefp) sd_json_variant *v = NULL;
- unsigned err_line, err_column;
+ unsigned err_line = 0, err_column = 0;
r = sd_json_parse_file(
f,
/* path = */ NULL,
_cleanup_(sd_json_variant_unrefp) sd_json_variant *jp = NULL;
_cleanup_(sd_varlink_unrefp) sd_varlink *vl = NULL;
const char *url, *method, *parameter, *source;
- unsigned line = 0, column = 0;
int r;
assert(argc >= 3);
if (!varlink_idl_qualified_symbol_name_is_valid(method))
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Not a valid qualified method name: '%s' (Expected valid Varlink interface name, followed by a dot, followed by a valid Varlink symbol name.)", method);
+ unsigned line = 0, column = 0;
if (parameter) {
source = "<argv[4]>";