[MERGED] libosmo-sccp[master]: sccp2sua: Avoid array overruns in sccp_is_{mandatory, optiona...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Apr 27 10:21:45 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: sccp2sua: Avoid array overruns in sccp_is_{mandatory,optional}()
......................................................................


sccp2sua: Avoid array overruns in sccp_is_{mandatory,optional}()

Change-Id: Ied76c21e20332514c2ad364eea5fc17e24a3f4c6
Fixes: coverity CID#166943, CID#166980
---
M src/sccp2sua.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



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 @@
 {
 	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 @@
 {
 	unsigned int i;
 
-	if (type > ARRAY_SIZE(sccp_optional))
+	if (type >= ARRAY_SIZE(sccp_optional))
 		return false;
 
 	for (i = 0; i < MAX_IES; i++) {

-- 
To view, visit https://gerrit.osmocom.org/2427
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ied76c21e20332514c2ad364eea5fc17e24a3f4c6
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list