From: aland Date: Tue, 23 Nov 2004 17:20:23 +0000 (+0000) Subject: In paircompare, don't get excited if the first attribute X-Git-Tag: release_2_0_0_pre1~1840 X-Git-Url: http://www.project-moonshot.org/gitweb/?a=commitdiff_plain;h=7eb1359633eb184bb4997be42f9349b4246cd593;p=freeradius.git In paircompare, don't get excited if the first attribute doesn't exist. It may be a "virtual" attribute, and there may be a comparison function registered for it. --- diff --git a/src/main/valuepair.c b/src/main/valuepair.c index b73fb77..deeffed 100644 --- a/src/main/valuepair.c +++ b/src/main/valuepair.c @@ -91,12 +91,16 @@ static int paircompare(REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check, /* * See if there is a special compare function. + * + * FIXME: use new RB-Tree code. */ for (c = cmp; c; c = c->next) if (c->attribute == check->attribute) return (c->compare)(c->instance, req, request, check, check_pairs, reply_pairs); + if (!request) return -1; /* doesn't exist, don't compare it */ + switch(check->type) { #ifdef ASCEND_BINARY /* @@ -362,7 +366,7 @@ int paircmp(REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check, VALUE_PAIR **r case T_OP_REG_EQ: { int i; - regmatch_t rxmatch[9]; + regmatch_t rxmatch[REQUEST_MAX_REGEX + 1]; /* * Include substring matches.