[asterisk-commits] chan dahdi.c: Fix bounds check regression. (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Dec 19 19:48:31 CST 2016


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

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 d224a20..97c80c8 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -18826,8 +18826,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/4631
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1fc408c1a083745ff59da5c4113041bbfce54bcb
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
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-commits mailing list