]> 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:44 +0000 (10:34 -0600)
commit2770cc58729398da402870302d5f56c034024a4a
treef1563ddfa0b29f40af0ac9b53c8ea54770261781
parent5a6f2f913b99613419f82b14aca60792760f7485
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