#39 "strncmp" should not be used to match header names

trunk
closed-duplicate
nobody
core (110)
5
2008-10-27
2008-10-27
No

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)

Discussion

    • status: open --> open-duplicate
     
    • status: open-duplicate --> closed-duplicate