summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2016-12-19 19:48:31 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2016-12-19 19:48:31 -0600
commit1943ece514b0ba6988b05f20e10305c1c476d90b (patch)
treea5e048943cac4076998308e9191899ae97425b99
parentcce4c07d839e73f9df0ee85e17e26d9b4803e343 (diff)
parent9404efa6f42fcdbf1e676ce5a43477c68e16162d (diff)
Merge "chan_dahdi.c: Fix bounds check regression."
-rw-r--r--channels/chan_dahdi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index d224a2044..97c80c83e 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 */