[OpenSIPS-Devel] [OpenSIPS/opensips] 4eabea: [tracer] avoid parsing the shm cloned SIP msg

Bogdan Andrei IANCU noreply at github.com
Thu Oct 27 12:25:11 UTC 2022


  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 4eabea8a9eb0a08909854722972cd35164557c76
      https://github.com/OpenSIPS/opensips/commit/4eabea8a9eb0a08909854722972cd35164557c76
  Author: Bogdan-Andrei Iancu <bogdan at opensips.org>
  Date:   2022-10-27 (Thu, 27 Oct 2022)

  Changed paths:
    M modules/tracer/tracer.c

  Log Message:
  -----------
  [tracer] avoid parsing the shm cloned SIP msg

The TM TMCB_MSG_SENT_OUT callback may be called when doing a retransmission for a locally generated request. If for the original sending, a pkg malloc'ed sip_msg is passed to TMCB_MSG_SENT_OUT callback, for the retransmissions the shm cloned sip_msg is passed. As the 'tracer' callback (on TMCB_MSG_SENT_OUT) requires some FROM hdr parsing (to get the from tag), it should NOT parse directly on the shm cloned SIP msg as it will tain the shm sip_msg with pkg pointers -> better do a local parsing (not attached to the sip_msg) of the FROM HDR.
This issue was leading to pkg leaking (of the parsed FROM hdr in the shm cloned sip_msg) or it a crash if using failure route from the local route.

Note: this is specific to using tracer module from the local route.
Closes  #2728





More information about the Devel mailing list