[Kamailio-Devel] [ openser-Feature Requests-2202141 ] "strncmp" should not be used to match header names
SourceForge.net
noreply at sourceforge.net
Tue Jan 6 23:40:46 CET 2009
Feature Requests item #2202141, was opened at 2008-10-28 01:05
Message generated for change (Comment added) made by miconda
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=743023&aid=2202141&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 devel
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Iñaki Baz (ibc_sf)
>Assigned to: Daniel-Constantin Mierla (miconda)
Summary: "strncmp" should not be used to match header names
Initial Comment:
All those results are bugs since they expect header names being case sensitive
while SIP syntax is case insensitive in header names:
/usr/src/kamailio-trunk$ grep -ri "strncmp(h" * | grep -v svn
sources/modules/peering/verify.c: if (strncmp(hf->name.s, "P-Request-Hash",
sources/modules/pua_bla/notify.c: if(strncmp(hdr->name.s, "Subscription-State",18)==0 )
sources/modules/rls/subscribe.c: if(strncmp(hdr->name.s, "Support", 7)== 0)
sources/modules/rls/subscribe.c: if(strncmp(hdr->body.s+ i, "eventlist", 9)== 0)
sources/modules/rls/resource_notify.c: if(strncmp(hdr->name.s, "Subscription-State", 18)==0)
sources/modules/pua_mi/mi_func.c: if(strncmp(hdr->name.s, "SIP-ETag",8)==0 )
sources/modules/pua/send_publish.c: if(strncmp(hdr->name.s, "SIP-ETag",8)==0 )
sources/modules/pua_xmpp/simple2xmpp.c: if(strncmp(hdr->name.s, "Subscription-State",18)==0 )
sources/modules/pua_xmpp/simple2xmpp.c: if(strncmp(hdr->name.s, "Subscription-State",18)==0 )
sources/modules/pua_xmpp/simple2xmpp.c: if(hdr && strncmp(hdr->body.s,"terminated", 10)== 0)
sources/modules/presence/publish.c: if(strncmp(hdr->name.s, "SIP-If-Match",12)==0||
sources/modules/presence/publish.c: strncmp(hdr->name.s,"Sip-If-Match",12)==0 )
sources/msg_translator.c: if (he && (strncmp(he->h_name, name->s, name->len)==0))
sources/msg_translator.c: if (strncmp(he->h_aliases[i],name->s, name->len)==0)
----------------------------------------------------------------------
>Comment By: Daniel-Constantin Mierla (miconda)
Date: 2009-01-07 00:40
Message:
Trunk is using a dedicated function to match header names by string
comparison. If there is some left, please re-open and point the file.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=743023&aid=2202141&group_id=139143
More information about the Devel
mailing list