]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip_diversion: Fix adding more than one histinfo to Supported
authorIvan Poddubnyi <ivan.poddubny@gmail.com>
Mon, 28 Dec 2020 12:43:23 +0000 (13:43 +0100)
committerGeorge Joseph <gjoseph@digium.com>
Thu, 18 Feb 2021 16:34:53 +0000 (10:34 -0600)
commit7d15655f9d19a62860fc6753be377d4e047b43d4
treec7425308079d545e245585d172427f35a5911675
parente7b13df39453126e65407d3d500bb5995c84046d
res_pjsip_diversion: Fix adding more than one histinfo to Supported

New responses sent within a PJSIP sessions are based on those that were
sent before. Therefore, adding/modifying a header once causes it to be
sent on all responses that follow.

Sending 181 Call Is Being Forwarded many times first adds "histinfo"
duplicated more and more, and eventually overflows past the array
boundary.

This commit adds a check preventing adding "histinfo" more than once,
and skipping it if there is no more space in the header.

Similar overflow situations can also occur in res_pjsip_path and
res_pjsip_outbound_registration so those were also modified to
check the bounds and suppress duplicate Supported values.

ASTERISK-29227
Reported by: Ivan Poddubny

Change-Id: Id43704a1f1a0293e35cc7f844026f0b04f2ac322
res/res_pjsip_diversion.c
res/res_pjsip_outbound_registration.c
res/res_pjsip_path.c