[Kamailio-Devel] [ openser-Bugs-2648714 ] dbtext.query returns the wrong rows, text columns & '<'

SourceForge.net noreply at sourceforge.net
Sat Feb 28 14:32:50 CET 2009


Bugs item #2648714, was opened at 2009-02-28 14:32
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=2648714&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: modules
Group: ver devel
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Edgar Holleis (ccaracalla)
Assigned to: Nobody/Anonymous (nobody)
Summary: dbtext.query returns the wrong rows, text columns & '<'

Initial Comment:
db_text's query function returns bad results if called with the operators '<', '<=', '>' and '>=' on text columns. 

Description of the bug in dbt_res.c:

- dbt_row_match() calls dbt_cmp_val() and expects -1, 0, or 1 in return, -2 to indicate error

- dbt_cmp_val() calls strncasecmp() and fails to take into account that the latter returns "a positive integer" or "a negative integer" to indicate bigger or smaller.

The patch passes the result of strncasecmp() through sign().

The bug is present in at least 1.3.x to trunk.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=2648714&group_id=139143



More information about the Devel mailing list