libsepol: Move assigning outer loop index out of inner loop

Assign value based on outer loop index in the outer loop instead
of the inner loop.

Signed-off-by: James Carter <jwcart2@gmail.com>
This commit is contained in:
James Carter 2022-01-11 12:41:58 -05:00
parent 8f643827b5
commit cfdf4ec289

View file

@ -158,8 +158,8 @@ static int report_assertion_extended_permissions(sepol_handle_t *handle,
tmp_key.specified = AVTAB_XPERMS_ALLOWED;
ebitmap_for_each_positive_bit(sattr, snode, i) {
tmp_key.source_type = i + 1;
ebitmap_for_each_positive_bit(tattr, tnode, j) {
tmp_key.source_type = i + 1;
tmp_key.target_type = j + 1;
for (node = avtab_search_node(avtab, &tmp_key);
node;
@ -334,8 +334,8 @@ static int check_assertion_extended_permissions_avtab(avrule_t *avrule, avtab_t
tmp_key.specified = AVTAB_XPERMS_ALLOWED;
ebitmap_for_each_positive_bit(sattr, snode, i) {
tmp_key.source_type = i + 1;
ebitmap_for_each_positive_bit(tattr, tnode, j) {
tmp_key.source_type = i + 1;
tmp_key.target_type = j + 1;
for (node = avtab_search_node(avtab, &tmp_key);
node;