[OpenSIPS-Devel] [OpenSIPS/opensips] 3c1037: route params: Fix regression in 8761ce6d20

Liviu Chircu noreply at github.com
Thu Feb 16 17:19:31 UTC 2023


  Branch: refs/heads/3.3
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 3c1037114e84f66410652fda4fa4e654909f413d
      https://github.com/OpenSIPS/opensips/commit/3c1037114e84f66410652fda4fa4e654909f413d
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2023-02-16 (Thu, 16 Feb 2023)

  Changed paths:
    M action.c

  Log Message:
  -----------
  route params: Fix regression in 8761ce6d20

The patch assumed that variables with PV_VAL_INT|PV_TYPE_INT have
symmetric values (e.g. 5 and "5"), whereas this is not always the case
(e.g. 1 and "INVITE", returned by $rm) and would proceed to duplicate
the output buffer as a int2str() buffer, for safety purposes.

The fix is to avoid the duplication completely (i.e. do not overwrite
"INVITE" with "1"), thanks to the route params array string buffers
having a sufficiently large lifetime in order to be safely returned to
the calling code asking for the route parameter.

(cherry picked from commit 6b9e140f6576ba66be6f74e686a5fd33c0a16603)





More information about the Devel mailing list