mirror of
https://github.com/SELinuxProject/selinux
synced 2025-01-18 19:30:47 +00:00
libsepol: use correct size for initial string list
Use the number of categories not levels, which might be zero, for the string list initial size of categories. Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
This commit is contained in:
parent
731540202a
commit
35ef9b95e7
@ -918,7 +918,7 @@ static int write_category_rules_to_conf(FILE *out, struct policydb *pdb)
|
||||
unsigned i, j, num;
|
||||
int rc = 0;
|
||||
|
||||
rc = strs_init(&strs, pdb->p_levels.nprim);
|
||||
rc = strs_init(&strs, pdb->p_cats.nprim);
|
||||
if (rc != 0) {
|
||||
goto exit;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user