]> 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:35:05 +0000 (10:35 -0600)
commit872c1786e6a3397b9041d462a33070645d55db3e
tree67a2dadf5636d39e13d6d031fd941f75053b394b
parent76125bec4adacbcca16affa9365c2fd0f472930c
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