There is no reason to modify the number of roles defined in a policy
when no role is being inserted.

Signed-off-by: Nicolas Iooss <[email protected]>
---
 libsepol/src/expand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libsepol/src/expand.c b/libsepol/src/expand.c
index 32df6f8b2ce6..7244e01fb50d 100644
--- a/libsepol/src/expand.c
+++ b/libsepol/src/expand.c
@@ -2424,7 +2424,7 @@ int role_set_expand(role_set_t * x, ebitmap_t * r, 
policydb_t * out, policydb_t
        ebitmap_init(r);
 
        if (x->flags & ROLE_STAR) {
-               for (i = 0; i < p->p_roles.nprim++; i++)
+               for (i = 0; i < p->p_roles.nprim; i++)
                        if (ebitmap_set_bit(r, i, 1))
                                return -1;
                return 0;
-- 
2.10.2

_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected].
To get help, send an email containing "help" to [email protected].

Reply via email to