Skip to content

Commit 205dbb8

Browse files
committed
Support gaps in type array
Support gaps in the type array which are supported by libsepol. Encountered while experimenting on a policy optimization step that removes unused type-attributes. Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
1 parent 305c8fa commit 205dbb8

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

setools/policyrep/selinuxpolicy.pxi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,10 @@ cdef class SELinuxPolicy:
934934
for i in range(self.handle.p.symtab[sepol.SYM_TYPES].nprim):
935935
tmp_type = self.handle.p.type_val_to_struct[i]
936936

937+
# skip gaps
938+
if tmp_type == NULL:
939+
continue
940+
937941
# skip types
938942
if tmp_type.flavor != sepol.TYPE_ATTRIB:
939943
continue

0 commit comments

Comments
 (0)