Skip to contentSkip to conversation

libsepol/cil: Set class field to NULL when resetting struct cil_classperms

PATCH New James Carter 1 participant 1 message Mar 18, 2021 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libsepol/cil: Set class field to NULL when resetting struct cil_classperms

The class field of a struct cil_classperms points to the class looked up in the symbol table, so that field should be set to NULL when the cil_classperms is reset.

Set the class field to NULL when resetting the struct cil_classperms.

---
 libsepol/cil/src/cil_reset_ast.c | 1 +
 1 file changed, 1 insertion(+)
libsepol/cil/src/cil_reset_ast.c +1 -0
index 0c74deeb..b76d5059 100644
@@ -45,6 +45,7 @@ static inline void cil_reset_classperms(struct cil_classperms *cp)
 		return;
 	}
 
+	cp->class = NULL;
 	cil_list_destroy(&cp->perms, CIL_FALSE);
 }
 
Signature · 1 line
2.26.2