diff mbox

[1/5] libsepol: do not modify p->p_roles.nprim in role_set_expand

Message ID 20161123220646.23504-1-nicolas.iooss@m4x.org (mailing list archive)
State Not Applicable
Headers show

Commit Message

Nicolas Iooss Nov. 23, 2016, 10:06 p.m. UTC
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 <nicolas.iooss@m4x.org>
---
 libsepol/src/expand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stephen Smalley Nov. 28, 2016, 2:19 p.m. UTC | #1
On 11/23/2016 05:06 PM, Nicolas Iooss wrote:
> There is no reason to modify the number of roles defined in a policy
> when no role is being inserted.

Thanks, applied.

> 
> Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
> ---
>  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;
>
diff mbox

Patch

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;