res_rtp_asterisk.c: Fix signed mismatch that leads to overflow

ASTERISK-29205 #close

Change-Id: Ib7aa65644e8df76e2378d7613ee7cf751b9d0bea
This commit is contained in:
Sean Bright 2020-12-11 15:49:48 -05:00 committed by George Joseph
parent acb7ce4fe7
commit 5a6f2f913b
1 changed files with 2 additions and 2 deletions

View File

@ -6932,7 +6932,7 @@ static int rtp_transport_wide_cc_feedback_produce(const void *data)
/* If there is no more room left for storing packets stop now, we leave 20
* extra bits at the end just in case.
*/
if ((sizeof(bdata) - (packet_len + delta_len + 20)) < 0) {
if (packet_len + delta_len + 20 > sizeof(bdata)) {
res = -1;
break;
}
@ -6966,7 +6966,7 @@ static int rtp_transport_wide_cc_feedback_produce(const void *data)
previous_packet = statistics;
/* If there is no more room left in the packet stop handling of any subsequent packets */
if ((sizeof(bdata) - (packet_len + delta_len + 20)) < 0) {
if (packet_len + delta_len + 20 > sizeof(bdata)) {
break;
}
}