[asterisk-commits] mjordan: trunk r431880 - in /trunk: ./ res/res_rtp_asterisk.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 16 15:29:41 CST 2015


Author: mjordan
Date: Mon Feb 16 15:29:39 2015
New Revision: 431880

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=431880
Log:
res/res_rtp_asterisk: Fix crash in debug from RTCP reports without report block

When RTCP debugging was enabled, an RTCP report without a report block would
cause a crash. This was due to the verbose output not checking to see if the
report_block pointer was NULl before dereferencing it.

This patch adds the necessary check to prevent printing any verbose output
if the far side hasn't provided us the information they should have.

ASTERISK-24791 #close
Reported by: JoshE
Tested by: JoshE
........

Merged revisions 431879 from http://svn.asterisk.org/svn/asterisk/branches/13

Modified:
    trunk/   (props changed)
    trunk/res/res_rtp_asterisk.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.

Modified: trunk/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_rtp_asterisk.c?view=diff&rev=431880&r1=431879&r2=431880
==============================================================================
--- trunk/res/res_rtp_asterisk.c (original)
+++ trunk/res/res_rtp_asterisk.c Mon Feb 16 15:29:39 2015
@@ -3056,14 +3056,16 @@
 			ast_verbose("  Sent packets: %u\n", rtcp_report->sender_information.packet_count);
 			ast_verbose("  Sent octets: %u\n", rtcp_report->sender_information.octet_count);
 		}
-		ast_verbose("  Report block:\n");
-		ast_verbose("    Their SSRC: %u\n", report_block->source_ssrc);
-		ast_verbose("    Fraction lost: %d\n", report_block->lost_count.fraction);
-		ast_verbose("    Cumulative loss: %u\n", report_block->lost_count.packets);
-		ast_verbose("    Highest seq no: %u\n", report_block->highest_seq_no);
-		ast_verbose("    IA jitter: %.4f\n", (double)report_block->ia_jitter / rate);
-		ast_verbose("    Their last SR: %u\n", report_block->lsr);
-		ast_verbose("    DLSR: %4.4f (sec)\n\n", (double)(report_block->dlsr / 65536.0));
+		if (report_block) {
+			ast_verbose("  Report block:\n");
+			ast_verbose("    Their SSRC: %u\n", report_block->source_ssrc);
+			ast_verbose("    Fraction lost: %d\n", report_block->lost_count.fraction);
+			ast_verbose("    Cumulative loss: %u\n", report_block->lost_count.packets);
+			ast_verbose("    Highest seq no: %u\n", report_block->highest_seq_no);
+			ast_verbose("    IA jitter: %.4f\n", (double)report_block->ia_jitter / rate);
+			ast_verbose("    Their last SR: %u\n", report_block->lsr);
+			ast_verbose("    DLSR: %4.4f (sec)\n\n", (double)(report_block->dlsr / 65536.0));
+		}
 	}
 
 	ast_rtp_instance_get_local_address(instance, &local_address);




More information about the asterisk-commits mailing list