[sr-dev] library for copying sip_msg from shm to pvt memory?

Jason Penton jason.penton at gmail.com
Thu Apr 28 11:00:22 CEST 2016


Does anybody know if there is an existing library function/s to copy a
sip_msg (typically request) from shm to pkg? I know there is already this
functionality in the tmx module but I think it would be useful to move this
into a library so it can be used by other modules? I am just wanting to
make sure before I replicate code...

*Reason for such functionality:*

The main reason is where modules need to access specific headers from a sip
request which they get from t->uas.request (generally in instances where
only the rpl message is accessible). We all know that t->uas.request sits
in SHM, so if any additional parsing is done on this message it's pointers
will be polluted with pvt memory addresses of the processing parsing the
request. This could ultimately lead to memory corruption and segfaults.

I would therefore propose moving the pv_t_copy_msg and associated functions
from tmx modules into the core library... any objections?

Cheers
Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20160428/43a0b33a/attachment-0001.html>


More information about the sr-dev mailing list