]> git.ipfire.org Git - thirdparty/asterisk.git/commit
chan_pjsip: Fix PJSIP_MEDIA_OFFER dialplan function read.
authorRichard Mudgett <rmudgett@digium.com>
Thu, 15 Jun 2017 17:33:22 +0000 (12:33 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 15 Jun 2017 17:35:38 +0000 (12:35 -0500)
commit83b6eda33bf60938a70b7c41648f65ba5e6fc91d
treebd75fadc312ee1a52f5d221daa4bb7523ad4d10f
parent7db1abbf874660e12ce0345e82ae23da7e71dd22
chan_pjsip: Fix PJSIP_MEDIA_OFFER dialplan function read.

The construction of the returned string assumed incorrectly that the
supplied buffer would always be initialized as an empty string.  If it is
not an empty string we could overrun the supplied buffer by the length of
the non-empty buffer string plus one.  It is also theoreticaly possible
for the supplied buffer to be overrun by a string terminator during a read
operation even if the supplied buffer is an empty string.

* Fix the assumption that the supplied buffer would already be an empty
string.  The buffer is not guaranteed to contain an empty string by all
possible callers.

* Fix string terminator buffer overrun potential.

Change-Id: If6a0806806527678c8554b1dcb34fd7808aa95c9
channels/pjsip/dialplan_functions.c