[Asterisk-code-review] chan dahdi.c: Fix bounds check regression. (asterisk[14])

Joshua Colp asteriskteam at digium.com
Mon Dec 19 19:37:04 CST 2016


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/4630 )

Change subject: chan_dahdi.c: Fix bounds check regression.
......................................................................


chan_dahdi.c: Fix bounds check regression.

Caused by ASTERISK-25494

Change-Id: I1fc408c1a083745ff59da5c4113041bbfce54bcb
---
M channels/chan_dahdi.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  George Joseph: Looks good to me, approved
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 8cccf84..71dbd35 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -18902,8 +18902,8 @@
 				}
 
 				/* This check is only needed to satisfy the compiler that element_count can't cause an out of bounds */
-				if (element_count >= ARRAY_LEN(c)) {
-					element_count = ARRAY_LEN(c) - 1;
+				if (element_count > ARRAY_LEN(c)) {
+					element_count = ARRAY_LEN(c);
 				}
 
 				/* Ring cadences cannot be negative */

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1fc408c1a083745ff59da5c4113041bbfce54bcb
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-code-review mailing list