libsepol/cil: do not use an uninitialized value in __cil_fqn_qualify_blocks

In __cil_fqn_qualify_blocks(), when newlen >= CIL_MAX_NAME_LENGTH,
cil_tree_log() is called with child_args.node as argument but this value
has not been initialized yet. Use local variable node instead, which is
initialized early enough in the function.

This issue has been found using clang's static analyzer.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
This commit is contained in:
Nicolas Iooss 2017-05-12 22:13:56 +02:00 committed by Stephen Smalley
parent 9cc62ce35d
commit 4a0fab43cb

View File

@ -121,7 +121,7 @@ static int __cil_fqn_qualify_blocks(__attribute__((unused)) hashtab_key_t k, has
exit:
if (rc != SEPOL_OK) {
cil_tree_log(child_args.node, CIL_ERR,"Problem qualifying names in block");
cil_tree_log(node, CIL_ERR,"Problem qualifying names in block");
}
return rc;