summaryrefslogtreecommitdiff
path: root/channels/chan_dahdi.c
diff options
context:
space:
mode:
authorGeorge Joseph <george.joseph@fairview5.com>2015-10-24 12:08:41 -0600
committerGeorge Joseph <george.joseph@fairview5.com>2015-10-24 12:50:40 -0600
commit5f593e7c38b260a9769d0e01b1edf24098599cd7 (patch)
tree0fbd68cc4eedd37ea469b4f88be0defbc9a78dc6 /channels/chan_dahdi.c
parentd818e6edceee45ffeeb1b536098d93d3c001aa9e (diff)
build: GCC 5.1.x catches some new const, array bounds and missing paren issues
Fixed 1 issue in each of the affected files. ASTERISK-25494 #close Reported-by: George Joseph Tested-by: George Joseph Change-Id: I818f149cd66a93b062df421e1c73c7942f5a4a77
Diffstat (limited to 'channels/chan_dahdi.c')
-rw-r--r--channels/chan_dahdi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 248a7fd10..ef0ad651a 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -18833,6 +18833,11 @@ static int process_dahdi(struct dahdi_chan_conf *confp, const char *cat, struct
cadence_is_ok = 0;
}
+ /* 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;
+ }
+
/* Ring cadences cannot be negative */
for (i = 0; i < element_count; i++) {
if (c[i] == 0) {