In semanage_direct_commit() error path, bools_modified can be used in a if statement without being initialized (when a "goto cleanup" is taken early). clang warns about this bug: direct_api.c:1441:18: error: variable 'bools_modified' may be uninitialized when used here [-Werror,-Wconditional-uninitialized] if (modified || bools_modified) { ^~~~~~~~~~~~~~ direct_api.c:1087:48: note: initialize the variable 'bools_modified' to silence this warning preserve_tunables_modified, bools_modified, ^ = 0 Signed-off-by: Nicolas Iooss <nicolas.iooss@xxxxxxx> --- libsemanage/src/direct_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsemanage/src/direct_api.c b/libsemanage/src/direct_api.c index 68dd0d18425a..dd621d99295e 100644 --- a/libsemanage/src/direct_api.c +++ b/libsemanage/src/direct_api.c @@ -1076,7 +1076,7 @@ static int semanage_direct_commit(semanage_handle_t * sh) /* Declare some variables */ int modified = 0, fcontexts_modified, ports_modified, seusers_modified, users_extra_modified, dontaudit_modified, - preserve_tunables_modified, bools_modified, + preserve_tunables_modified, bools_modified = 0, disable_dontaudit, preserve_tunables; dbase_config_t *users = semanage_user_dbase_local(sh); dbase_config_t *users_base = semanage_user_base_dbase_local(sh); -- 2.7.0 _______________________________________________ Selinux mailing list Selinux@xxxxxxxxxxxxx To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx. To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.