From: Richard Mudgett Date: Wed, 14 Dec 2016 20:21:47 +0000 (-0600) Subject: chan_dahdi.c: Fix bounds check regression. X-Git-Tag: 13.14.0-rc1~63^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b285d226d2e9d92f1be53e84435c7d4cbf290be;p=thirdparty%2Fasterisk.git chan_dahdi.c: Fix bounds check regression. Caused by ASTERISK-25494 Change-Id: I1fc408c1a083745ff59da5c4113041bbfce54bcb --- diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 2e139a2342..6d740d064b 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -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 */