invalid msg_buf in return arg of pjsip_rx_data_clone

Андрей Черных
Tue, Sep 17, 2019 8:45 AM

Function pjsip_rx_data_clone has invalid dst->msg_info.msg_buf pointer.
It points to dst->pkt_info.packet and ignores offset of
*src->msg_info.msg_buf
*from src->pkt_info.packet.

Some modules (for example pjsua_lib) is using this method to notify
account with incoming call and end-user application can see only part of
invite in the end of message and some stuff in the beginning.

I think, that validation of src->msg_info.msg_buf (that it points to*
dst->pkt_info.packet*)  is not required because msg_buf assignment is doing
only in *pjsip_tpmgr_receive_packet *and in
pjsip_rx_data_clone.

Patch in attachement.

--
Best regards,
Andrew A. Chernyh

Function *pjsip_rx_data_clone* has invalid *dst->msg_info.msg_buf* pointer. It points to *dst->pkt_info.packet* and ignores offset of *src->msg_info.msg_buf *from *src->pkt_info.packet*. Some modules (for example *pjsua_lib*) is using this method to notify account with incoming call and end-user application can see only part of invite in the end of message and some stuff in the beginning. I think, that validation of *src->msg_info.msg_buf* (that it points to* dst->pkt_info.packet*) is not required because msg_buf assignment is doing only in *pjsip_tpmgr_receive_packet *and in *pjsip_rx_data_clone.* Patch in attachement. -- Best regards, Andrew A. Chernyh
NI
Nanang Izzuddin
Thu, Oct 10, 2019 6:56 AM

Hi Andrew,

Have just checked in the patch to the SVN trunk with ticket
https://trac.pjsip.org/repos/ticket/2242.
Thank you for the patch.

BR,
nanang

On Tue, Sep 17, 2019 at 3:46 PM Андрей Черных andrew.chernyh@gmail.com
wrote:

Function pjsip_rx_data_clone has invalid dst->msg_info.msg_buf
pointer.
It points to dst->pkt_info.packet and ignores offset of *src->msg_info.msg_buf
*from src->pkt_info.packet.

Some modules (for example pjsua_lib) is using this method to notify
account with incoming call and end-user application can see only part of
invite in the end of message and some stuff in the beginning.

I think, that validation of src->msg_info.msg_buf (that it points to*
dst->pkt_info.packet*)  is not required because msg_buf assignment is
doing only in *pjsip_tpmgr_receive_packet *and in
pjsip_rx_data_clone.

Patch in attachement.

--
Best regards,
Andrew A. Chernyh


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Hi Andrew, Have just checked in the patch to the SVN trunk with ticket https://trac.pjsip.org/repos/ticket/2242. Thank you for the patch. BR, nanang On Tue, Sep 17, 2019 at 3:46 PM Андрей Черных <andrew.chernyh@gmail.com> wrote: > Function *pjsip_rx_data_clone* has invalid *dst->msg_info.msg_buf* > pointer. > It points to *dst->pkt_info.packet* and ignores offset of *src->msg_info.msg_buf > *from *src->pkt_info.packet*. > > Some modules (for example *pjsua_lib*) is using this method to notify > account with incoming call and end-user application can see only part of > invite in the end of message and some stuff in the beginning. > > I think, that validation of *src->msg_info.msg_buf* (that it points to* > dst->pkt_info.packet*) is not required because msg_buf assignment is > doing only in *pjsip_tpmgr_receive_packet *and in > *pjsip_rx_data_clone.* > > Patch in attachement. > > > > > -- > Best regards, > Andrew A. Chernyh > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >