[OpenSIPS-Devel] [OpenSIPS/opensips] 52cd9d: topo_hiding: always allocate space for DID in user

Răzvan Crainea noreply at github.com
Thu Oct 29 10:38:32 EST 2020


  Branch: refs/heads/3.1
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 52cd9df68bdd9093334306068fc1aad79d877748
      https://github.com/OpenSIPS/opensips/commit/52cd9df68bdd9093334306068fc1aad79d877748
  Author: Razvan Crainea <razvan at opensips.org>
  Date:   2020-10-29 (Thu, 29 Oct 2020)

  Changed paths:
    M modules/topology_hiding/topo_hiding_logic.c

  Log Message:
  -----------
  topo_hiding: always allocate space for DID in user

When contact could not be parsed, the new Contact's prefix was not
allocating bytes in buffer for storing for the dialog ID in the user
part. However, the DID was appended to the prefix without any error
checks, resulting in a memory corruption. This commit always allocates
spaces for storing the Dialog ID, even if the contact could not be
parsed.
This fixes all uses of the topology_hiding() function with the `D` flag.

Thanks a lot Sergei Lavrov (@ccppprogrammer) for reporting this in
ticket #2285 and for offering information for figure it out. Close #2285

(cherry picked from commit 2ea8f86813bfbf87b4b0ab61c9f3e852ce777f4c)





More information about the Devel mailing list