libsepol/cil: Return SEPOL_ERR on failure to set bit
PATCH 1/1 libsepol/cil: Return SEPOL_ERR on failure to set bit
The functions cil_typepermissive_to_policydb() and cil_typeneveraudit_to_policydb() return rc when ebitmap_set_bit() fails, but the rc value at the point is SEPOL_OK.
Return SEPOL_ERR instead of rc when ebitmap_set_bit() fails.
--- libsepol/cil/src/cil_binary.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
libsepol/cil/src/cil_binary.c +2 -2
@@ -614,7 +614,7 @@ int cil_typepermissive_to_policydb(policydb_t *pdb,return rc;if (ebitmap_set_bit (&pdb->permissive_map, sepol_type->s.value,1 )) { -return rc; +return SEPOL_ERR ; }return SEPOL_OK ;
@@ -632,7 +632,7 @@ int cil_typeneveraudit_to_policydb(policydb_t *pdb,return rc;if (ebitmap_set_bit (&pdb->neveraudit_map, sepol_type->s.value,1 )) { -return rc; +return SEPOL_ERR ; }return SEPOL_OK ;
Signature · 1 line
2.55.0
Quoted 8 lines · James Carter
The functions
cil_typepermissive_to_policydb()andcil_typeneveraudit_to_policydb()return rc whenebitmap_set_bit()fails, but the rc value at the point isSEPOL_OK.Return
SEPOL_ERRinstead of rc whenebitmap_set_bit()fails.Signed-off-by James Carter <[email protected]>
Quoted 29 lines
--- libsepol/cil/src/cil_binary.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)libsepol/cil/src/cil_binary.c +2
-3@@ -614,7 +614,7 @@ int cil_typepermissive_to_policydb(policydb_t *pdb,return rc;if (ebitmap_set_bit (&pdb->permissive_map, sepol_type->s.value,1 )) { -return rc; +return SEPOL_ERR ; }return SEPOL_OK ;@@ -632,7 +632,7 @@ int cil_typeneveraudit_to_policydb(policydb_t *pdb,return rc;if (ebitmap_set_bit (&pdb->neveraudit_map, sepol_type->s.value,1 )) { -return rc; +return SEPOL_ERR ; }return SEPOL_OK ; --2.55.0
Stephen Smalley
maintainerQuoted 7 lines · Stephen Smalley
Quoted 5 lines · James Carter
The functions
cil_typepermissive_to_policydb()andcil_typeneveraudit_to_policydb()return rc whenebitmap_set_bit()fails, but the rc value at the point isSEPOL_OK.
Quoted 5 lines
Quoted 3 lines
Return
SEPOL_ERRinstead of rc whenebitmap_set_bit()fails.Signed-off-by James Carter <[email protected]>Acked-by Stephen Smalley <[email protected]>
Merged.