From: William Roberts <william.c.roberts@xxxxxxxxx> Signed-off-by: William Roberts <william.c.roberts@xxxxxxxxx> --- libsepol/src/mls.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libsepol/src/mls.c b/libsepol/src/mls.c index 1e84bb7..2dc5f2b 100644 --- a/libsepol/src/mls.c +++ b/libsepol/src/mls.c @@ -262,6 +262,7 @@ int mls_context_isvalid(const policydb_t * p, const context_struct_t * c) user_datum_t *usrdatum; unsigned int i, l; ebitmap_node_t *cnode; + hashtab_key_t key; if (!p->mls) return 1; @@ -279,11 +280,12 @@ int mls_context_isvalid(const policydb_t * p, const context_struct_t * c) if (!c->range.level[l].sens || c->range.level[l].sens > p->p_levels.nprim) return 0; - levdatum = (level_datum_t *) hashtab_search(p->p_levels.table, - p-> - p_sens_val_to_name - [c->range.level[l]. - sens - 1]); + + key = p->p_sens_val_to_name[c->range.level[l].sens - 1]; + if (!key) + return 0; + + levdatum = (level_datum_t *) hashtab_search(p->p_levels.table, key); if (!levdatum) return 0; -- 1.9.1 _______________________________________________ Selinux mailing list Selinux@xxxxxxxxxxxxx To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx. To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.