[Asterisk-code-review] res/res pjsip t38: fix incorrect increment of media count (asterisk[13])

Torrey Searle asteriskteam at digium.com
Tue Jun 27 10:49:16 CDT 2017


Torrey Searle has uploaded this change for review. ( https://gerrit.asterisk.org/5913


Change subject: res/res_pjsip_t38: fix incorrect increment of media_count
......................................................................

res/res_pjsip_t38: fix incorrect increment of media_count

The T38 sdp callback incorrectly has a side effect of incrementing
the media_count.  This can lead to core dumps.

Change-Id: I7bb2f4987de4046ec52cfc34e5ea0662dae32af8
---
M res/res_pjsip_t38.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/13/5913/1

diff --git a/res/res_pjsip_t38.c b/res/res_pjsip_t38.c
index 0ce6474..4e76ac3 100644
--- a/res/res_pjsip_t38.c
+++ b/res/res_pjsip_t38.c
@@ -278,7 +278,7 @@
 	/* Move the image media stream to the front and have it as the only stream, pjmedia will fill in
 	 * dummy streams for the rest
 	 */
-	for (stream = 0; stream < sdp->media_count++; ++stream) {
+	for (stream = 0; stream < sdp->media_count; ++stream) {
 		if (!pj_strcmp2(&sdp->media[stream]->desc.media, "image")) {
 			sdp->media[0] = sdp->media[stream];
 			sdp->media_count = 1;

-- 
To view, visit https://gerrit.asterisk.org/5913
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7bb2f4987de4046ec52cfc34e5ea0662dae32af8
Gerrit-Change-Number: 5913
Gerrit-PatchSet: 1
Gerrit-Owner: Torrey Searle <tsearle at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170627/70072c04/attachment.html>


More information about the asterisk-code-review mailing list