From 0729d5b28c8cc4763cf17e6d1a9b657098438b8f Mon Sep 17 00:00:00 2001 From: Eric Paris Date: Wed, 13 Oct 2010 17:50:14 -0400 Subject: [PATCH] --- yaml --- r: 211682 b: refs/heads/master c: 4419aae1f4f380a3fba0f4f12ffbbbdf3f267c51 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/security/selinux/ss/policydb.c | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 067277e62dbc..e79f34974829 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b28efd54d9d5c8005a29cd8782335beb9daaa32d +refs/heads/master: 4419aae1f4f380a3fba0f4f12ffbbbdf3f267c51 diff --git a/trunk/security/selinux/ss/policydb.c b/trunk/security/selinux/ss/policydb.c index aa5a2fd1cc09..97fb0cf0eb69 100644 --- a/trunk/security/selinux/ss/policydb.c +++ b/trunk/security/selinux/ss/policydb.c @@ -185,9 +185,19 @@ static u32 rangetr_hash(struct hashtab *h, const void *k) static int rangetr_cmp(struct hashtab *h, const void *k1, const void *k2) { const struct range_trans *key1 = k1, *key2 = k2; - return (key1->source_type != key2->source_type || - key1->target_type != key2->target_type || - key1->target_class != key2->target_class); + int v; + + v = key1->source_type - key2->source_type; + if (v) + return v; + + v = key1->target_type - key2->target_type; + if (v) + return v; + + v = key1->target_class - key2->target_class; + + return v; } /*