From: Douglas Bagnall Date: Fri, 10 Nov 2023 03:13:40 +0000 (+1300) Subject: libcli/security: CA: tokens_are_comparable() considers the obvious X-Git-Tag: talloc-2.4.2~521 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6e15a20228c78e0f7b74da2fc4bc7edd78b6507f;p=thirdparty%2Fsamba.git libcli/security: CA: tokens_are_comparable() considers the obvious Existing callers already make this check, but we are soon going to use it in contexts that don't. Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/libcli/security/conditional_ace.c b/libcli/security/conditional_ace.c index 5d945c0b0bb..9f2899eaef5 100644 --- a/libcli/security/conditional_ace.c +++ b/libcli/security/conditional_ace.c @@ -1276,6 +1276,9 @@ static bool tokens_are_comparable(const struct ace_condition_token *op, * 1, and the operator is == or !=. */ //XXX actually it says "literal integers", do we need to check flags? + if (lhs->type == rhs->type) { + return true; + } if (IS_INT_TOKEN(lhs) && IS_INT_TOKEN(rhs)) { /* don't block e.g. comparing an int32 to an int64 */