chan_dahdi.c: Fix bounds check regression.

Caused by ASTERISK-25494

Change-Id: I1fc408c1a083745ff59da5c4113041bbfce54bcb
This commit is contained in:
Richard Mudgett
2016-12-14 14:21:47 -06:00
parent cd46e86491
commit 4b285d226d
+2 -2
View File
@@ -18905,8 +18905,8 @@ static int process_dahdi(struct dahdi_chan_conf *confp, const char *cat, struct
}
/* 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 */