[Asterisk-code-review] res_rtp_asterisk.c: Fix signed mismatch that leads to overflow (asterisk[17])
George Joseph
asteriskteam at digium.com
Thu Feb 18 10:33:30 CST 2021
George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/15488 )
Change subject: res_rtp_asterisk.c: Fix signed mismatch that leads to overflow
......................................................................
res_rtp_asterisk.c: Fix signed mismatch that leads to overflow
ASTERISK-29205 #close
Change-Id: Ib7aa65644e8df76e2378d7613ee7cf751b9d0bea
---
M res/res_rtp_asterisk.c
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
George Joseph: Looks good to me, approved; Approved for Submit
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 1820ab1..2ed1831 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -6871,7 +6871,7 @@
/* 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;
}
@@ -6905,7 +6905,7 @@
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;
}
}
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15488
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 17
Gerrit-Change-Id: Ib7aa65644e8df76e2378d7613ee7cf751b9d0bea
Gerrit-Change-Number: 15488
Gerrit-PatchSet: 2
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-CC: Friendly Automation
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210218/dc68a4b5/attachment.html>
More information about the asterisk-code-review
mailing list