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

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Oct 28 10:29:58 CET 2008


Hi Iñaki,

Thanks for pointing this out - there is already available on SVN trunk a 
fix for this problem. Please update and test.

Best regards,
Bogdan

Iñaki Baz Castillo wrote:
> 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)
>
>   




More information about the Devel mailing list