[Asterisk-code-review] res_pjsip_nat.c: Create deep copies of strings when appropriate (asterisk[16])

nappsoft asteriskteam at digium.com
Tue Dec 8 11:51:30 CST 2020


nappsoft has uploaded a new patch set (#2). ( https://gerrit.asterisk.org/c/asterisk/+/15209 )

Change subject: res_pjsip_nat.c: Create deep copies of strings when appropriate
......................................................................

res_pjsip_nat.c: Create deep copies of strings when appropriate

In rewrite_uri asterisk was not making deep copies of strings when
changing the uri. This was in some cases causing garbage in the route
header and in other cases even crashing asterisk when receiving a
message with a record-route header set. Thanks to Ralf Kubis for
pointing out why this happens. A similar problem was found in
res_pjsip_transport_websocket.c. Pjproject needs as well to be patched
to avoid garbage in CANCEL messages.

It was as well observed that (at least for incoming messages)
rewrite_uri is called twice, if a record-route header is set as the
record-route header is already part of the dialog's route_set. This was
causing crashes in some cases as well. So the patch also prevents
asterisk from calling rewrite_uri twice on incoming messages if a
record-route header is set.

ASTERISK-29024 #close

Change-Id: Ic5acd7fa2fbda3080f5f36ef12e46804939b198b
---
M res/res_pjsip_nat.c
M res/res_pjsip_transport_websocket.c
A third-party/pjproject/patches/0070-fix-incorrect-copying-when-creating-cancel.patch
3 files changed, 29 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/09/15209/2
-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15209
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Ic5acd7fa2fbda3080f5f36ef12e46804939b198b
Gerrit-Change-Number: 15209
Gerrit-PatchSet: 2
Gerrit-Owner: nappsoft <infos at nappsoft.ch>
Gerrit-CC: Friendly Automation
Gerrit-MessageType: newpatchset
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20201208/f10660a5/attachment.html>


More information about the asterisk-code-review mailing list