[OpenSIPS-Devel] Doubt about hash ID

Daniel Zanutti daniel.zanutti at gmail.com
Fri Jan 26 12:32:14 EST 2018


Hey

I got this error on Opensips:
*/sbin/opensips[9189]: ERROR:dialog:parse_dlg_rr_param: invalid hash id
'efd60008'*

Checking the failling function:
inline static int reverse_hex2int( char *c, int len )
{
        char *pc;
        int r;
        char mychar;

        r=0;
        for (pc=c+len-1; len>0; pc--, len--) {
                r <<= 4 ;
                mychar=*pc;
                if ( mychar >='0' && mychar <='9') r+=mychar -'0';
                else if (mychar >='a' && mychar <='f') r+=mychar -'a'+10;
                else if (mychar  >='A' && mychar <='F') r+=mychar -'A'+10;
                else return -1;
        }
        return r;
}

Converting manually, looks like it passed int limit: efd60008 = 4023779336
> Limit 2147483647

The doubt is: Shouldn't this function return "unsigned int" instead of
"int"? Is this the problem or am I seeing something wrong?

I'm using opensips 1.11.9.

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20180126/d00e3134/attachment.html>


More information about the Devel mailing list