From: Richard Mudgett Date: Wed, 14 Dec 2016 20:21:47 +0000 (-0600) Subject: chan_dahdi.c: Fix bounds check regression. X-Git-Tag: 14.3.0-rc1~66^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d3f6e903bc69828ad3e380e47cc60f6546f1fb5;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 8cccf843b4..71dbd35f19 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -18902,8 +18902,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 */