summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2015-02-16 21:29:39 +0000
committerMatthew Jordan <mjordan@digium.com>2015-02-16 21:29:39 +0000
commitd808eace5c308bafc9b592d94d7b7c2b98b1e84c (patch)
tree5f40ee9dc5da4c82bcf87f8897592e1be5ba70ae
parent55eb8fc068d65ece71371578c55f2414bffd6cfa (diff)
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 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431880 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--res/res_rtp_asterisk.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 4982353a4..af017a103 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -3056,14 +3056,16 @@ static int ast_rtcp_write_report(struct ast_rtp_instance *instance, int sr)
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);