Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libselinux/utils: drop reachable assert in sefcontext_compile
The two asserts following qsort(3) where useful during development to ensure the comparison function and the corresponding pointer handling were correct. They however do not take into account an empty file context definition file containing no definitions and thus `stab->nel` being NULL. Drop the two asserts. Also return early to not depend on whether calloc(3) called with a size of zero returns NULL or a special value. Reported-by: Petr Lautrbach <[email protected]> Closes: https://lore.kernel.org/selinux/[email protected]/ Fixes: 92306da ("libselinux: rework selabel_file(5) database") Signed-off-by: Christian Göttsche <[email protected]> Tested-by: Petr Lautrbach <[email protected]> Acked-by: James Carter <[email protected]>
- Loading branch information