[OpenSIPS-Devel] "strncmp" should not be used to match header names

Iñaki Baz Castillo ibc at aliax.net
Mon Oct 27 23:58:45 CET 2008


All those results are bugs since they expect header names being case sensitive:

~# /usr/src/opensips-trunk/sources/modules$ grep -ri "strncmp(h" * | grep -v svn
peering/verify.c:       if (strncmp(hf->name.s, "P-Request-Hash",
presence/publish.c:             if(strncmp(hdr->name.s, "SIP-If-Match",12)==0||
presence/publish.c:                             strncmp(hdr->name.s,"Sip-If-Match",12)==0 )
pua/send_publish.c:             if(strncmp(hdr->name.s, "SIP-ETag",8)==0 )
pua_bla/notify.c:               if(strncmp(hdr->name.s, "Subscription-State",18)==0 )
pua_mi/mi_func.c:                       if(strncmp(hdr->name.s, "SIP-ETag",8)==0 )
pua_xmpp/simple2xmpp.c:                 if(strncmp(hdr->name.s, "Subscription-State",18)==0 )
pua_xmpp/simple2xmpp.c:                         if(strncmp(hdr->name.s, "Subscription-State",18)==0 )
pua_xmpp/simple2xmpp.c:                 if(hdr && strncmp(hdr->body.s,"terminated", 10)== 0)
rls/subscribe.c:                if(strncmp(hdr->name.s, "Support", 7)== 0)
rls/subscribe.c:                        if(strncmp(hdr->body.s+ i, "eventlist", 9)== 0)
rls/resource_notify.c:          if(strncmp(hdr->name.s, "Subscription-State", 18)==0)

-- 
Iñaki Baz Castillo



More information about the Devel mailing list