[Asterisk-code-review] res rtp asterisk: Drop RTCP packets less than 2 words in le... (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Wed Sep 6 18:37:57 CDT 2017


Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/6443 )

Change subject: res_rtp_asterisk:  Drop RTCP packets less than 2 words in length
......................................................................


Patch Set 2: Code-Review-1

(2 comments)

https://gerrit.asterisk.org/#/c/6443/2/res/res_rtp_asterisk.c
File res/res_rtp_asterisk.c:

https://gerrit.asterisk.org/#/c/6443/2/res/res_rtp_asterisk.c@4608
PS2, Line 4608: 	if (packetwords < 2) {
This test isn't necessary.  The length test below will take care of it.


https://gerrit.asterisk.org/#/c/6443/2/res/res_rtp_asterisk.c@4621
PS2, Line 4621: 		if ((i + (length & 0xffff)) > packetwords) {
* This test should be done after the length is calculated.

* We need to add this check after testing the packet length to ensure that the encoded packet record length is at least large enough for the fields we will read from the record:

unsigned int min_len;

min_len = 2; /* length and ssrc */
switch (pt) {
case RTCP_PT_SR:
   min_len += 5;
   /* fall through */
case RTCP_PT_RR:
   min_len += 5;
   break;
default:
   break;
}
if (length < min_len) {
   ast_debug(1, "Packet RTCP record too short\n");
   return &ast_null_frame;
}

The switch min_len values are determined by the later switch cases.



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

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: I67d89e3c27db83efa0e6b52734f73c88ac2939e2
Gerrit-Change-Number: 6443
Gerrit-PatchSet: 2
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-Comment-Date: Wed, 06 Sep 2017 23:37:57 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170906/037239e1/attachment.html>


More information about the asterisk-code-review mailing list