]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix paircmp
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 18 May 2018 03:31:03 +0000 (09:31 +0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 18 May 2018 03:31:03 +0000 (09:31 +0600)
src/main/paircmp.c

index 3e5aaad9db9cbc047153fd3ec9a7cf0e1d0f80d0..dd9eea9ca286662f7c1948d09ed33f04daaa974b 100644 (file)
@@ -330,6 +330,11 @@ int paircmp_pairs(UNUSED REQUEST *request, VALUE_PAIR *check, VALUE_PAIR *vp)
        if (check->op == T_OP_CMP_TRUE)  return 0;
        if (check->op == T_OP_CMP_FALSE) return 1;
 
+       if (!vp) {
+               REDEBUG("Non-Unary operations require two operands");
+               return -2;
+       }
+
 #ifdef HAVE_REGEX
        if ((check->op == T_OP_REG_EQ) || (check->op == T_OP_REG_NE)) {
                ssize_t         slen;