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

Richard Mudgett asteriskteam at digium.com
Wed Dec 14 14:24:18 CST 2016


Richard Mudgett has uploaded a new change for review. ( 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(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/31/4631/1

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: newchange
Gerrit-Change-Id: I1fc408c1a083745ff59da5c4113041bbfce54bcb
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list