summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-04-27 10:55:03 +0200
committerHarald Welte <laforge@gnumonks.org>2017-04-27 10:55:03 +0200
commitbf849e4bf053ba3eb83c6469dc158075d9a788ee (patch)
treeea0ced9fded7a2d9f9413f3d3efee14e2e8ceda6
parent7c56ab30c9dfd8069f69946c8d8aed61aafbbf18 (diff)
sccp2sua: Avoid array overruns in sccp_is_{mandatory,optional}()
Change-Id: Ied76c21e20332514c2ad364eea5fc17e24a3f4c6 Fixes: coverity CID#166943, CID#166980
-rw-r--r--src/sccp2sua.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sccp2sua.c b/src/sccp2sua.c
index 26e3f44..7268e27 100644
--- a/src/sccp2sua.c
+++ b/src/sccp2sua.c
@@ -881,7 +881,7 @@ static bool sccp_is_mandatory(enum sccp_message_types type, const struct xua_msg
{
unsigned int i;
- if (type > ARRAY_SIZE(sccp_mandatory))
+ if (type >= ARRAY_SIZE(sccp_mandatory))
return false;
for (i = 0; i < MAX_IES; i++) {
@@ -903,7 +903,7 @@ static bool sccp_option_permitted(enum sccp_message_types type, const struct xua
{
unsigned int i;
- if (type > ARRAY_SIZE(sccp_optional))
+ if (type >= ARRAY_SIZE(sccp_optional))
return false;
for (i = 0; i < MAX_IES; i++) {