[Kamailio-Devel] [ openser-Bugs-2044415 ] Matching operators fail to match on some platforms
SourceForge.net
noreply at sourceforge.net
Mon Sep 22 12:43:05 CEST 2008
Bugs item #2044415, was opened at 2008-08-10 02:10
Message generated for change (Settings changed) made by miconda
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=2044415&group_id=139143
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: ver 1.3.x
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Amy Linari (amylinari)
Assigned to: Daniel-Constantin Mierla (miconda)
Summary: Matching operators fail to match on some platforms
Initial Comment:
Due to a bug in route.c, the regular expression matching operators do not work in all environments. For example, when building 1.4.0 or 1.3.2 on Solaris 10 (sun4v or x86) they give the same result independent of input. It would seem that if it were not for the accident of a particular struct alignment, these operators would be broken on all platforms.
The underlying problem is a bad test in comp_s2s, which expects s2 to be a str*, and tests st->s==NULL. When handling the matching operators MATCH_OP and NOTMATCH_OP, it is a regex_t* instead - a fact reflected in the cast under the appropriate switch case.
The attached patch moves these special case tests into a new function comp_s2r which handles MATCH_OP and NOTMATCH_OP comparisons with the correct types and tests. This should be trivial to apply to 1.4.0 though the patch was made against 1.3.2.
----------------------------------------------------------------------
Comment By: Daniel-Constantin Mierla (miconda)
Date: 2008-08-15 12:12
Message:
Logged In: YES
user_id=1246013
Originator: NO
I applied the patch with a small update to catch all operation for
matching when right value is static. The code is much cleaner with
comp_s2r() as it eliminates inner casts and brings dedicated function for
regexp comparison, along with existing ones for numeric and string
comparisons.
Would be great if you can report the results. I will take care of
backporting then.
----------------------------------------------------------------------
Comment By: Daniel-Constantin Mierla (miconda)
Date: 2008-08-11 10:04
Message:
Logged In: YES
user_id=1246013
Originator: NO
I will review and fix the issue. Thanks for reporting.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=2044415&group_id=139143
More information about the Devel
mailing list