We have found an issue in version 5.2
To reproduce it
```
$var(x) = "wg48D8NPIJ5JEfkgqhuu+Q==";
$var(decode64) = $(var(x){s.decode.base64});
$var(encode16) = $(var(decode64){s.encode.hexa});
```
after these line the value of encode16 must be 'c20e3c0fc34f209e4911f920aa1baef9'
Looking inside the module pv, file pv_trans.c, line 347, we realized that the code is not
correct because the shift operation keeps the sign,
`_tr_buffer[j++] = fourbits2char[val->rs.s[i] >> 4];`
we saw that if we modifies the previous line with the following
`_tr_buffer[j++] = fourbits2char[(unsigned char)(val->rs.s[i]) >> 4];`
the function works as expected
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2690