From 9404efa6f42fcdbf1e676ce5a43477c68e16162d Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Wed, 14 Dec 2016 14:21:47 -0600 Subject: [PATCH] chan_dahdi.c: Fix bounds check regression. Caused by ASTERISK-25494 Change-Id: I1fc408c1a083745ff59da5c4113041bbfce54bcb --- channels/chan_dahdi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index d224a20445..97c80c83e3 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -18826,8 +18826,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 */