[PATCH] osmo-iuh[master]: hnbgw_rua: reject invalid domain indicator

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/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Sat Nov 26 12:02:15 UTC 2016


Review at  https://gerrit.osmocom.org/1303

hnbgw_rua: reject invalid domain indicator

Fixes: CID#135226, CID#135227
Change-Id: I0c44179aac02772585214e528207e959ad168f3c
---
M src/hnbgw_rua.c
1 file changed, 14 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/03/1303/1

diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c
index 3f245b5..ca745b1 100644
--- a/src/hnbgw_rua.c
+++ b/src/hnbgw_rua.c
@@ -347,6 +347,11 @@
 	case RUA_CN_DomainIndicator_ps_domain:
 		cn = hnb->gw->cnlink_ps;
 		break;
+	default:
+		LOGP(DRUA, LOGL_ERROR, "Invalid CN_DomainIndicator: %u\n",
+		     ies.cN_DomainIndicator);
+		rc = -1;
+		goto error_free;
 	}
 
 	if (ies.presenceMask & DISCONNECTIES_RUA_RANAP_MESSAGE_PRESENT) {
@@ -356,6 +361,8 @@
 
 	rc = rua_to_scu(hnb, cn, OSMO_SCU_PRIM_N_DISCONNECT,
 			context_id, scu_cause, ranap_data, ranap_len);
+
+error_free:
 	/* FIXME: what to do with the asn1c-allocated memory */
 	rua_free_disconnecties(&ies);
 
@@ -386,11 +393,18 @@
 	case RUA_CN_DomainIndicator_ps_domain:
 		cn = hnb->gw->cnlink_ps;
 		break;
+	default:
+		LOGP(DRUA, LOGL_ERROR, "Invalid CN_DomainIndicator: %u\n",
+		     ies.cN_DomainIndicator);
+		rc = -1;
+		goto error_free;
 	}
 
 	rc = rua_to_scu(hnb, cn, OSMO_SCU_PRIM_N_DATA,
 			context_id, 0, ies.ranaP_Message.buf,
 			ies.ranaP_Message.size);
+
+error_free:
 	/* FIXME: what to do with the asn1c-allocated memory */
 	rua_free_directtransferies(&ies);
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c44179aac02772585214e528207e959ad168f3c
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list