libsepol: potential NULL dereference from next_entry()
PATCH 1/1 libsepol: potential NULL dereference from next_entry()
This patch fixes a bug found by Coverity:
If next_entry returns NULL in role_trans_rule_read(), we nevertheless reference buf[0].
policydb.c +2 -0
@@ -2145,6 +2145,8 @@ static int role_trans_rule_read(role_trareturn -1 ; buf =next_entry (fp,sizeof (uint32_t )); +if (!buf) +return -1 ; tr->new_role =le32_to_cpu (buf[0 ]); ltr = tr; }
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.