[PATCH] osmo-iuh[master]: hnbgw_rua: fix dereference of unset pointer

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
Mon Jan 15 22:31:43 UTC 2018


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

hnbgw_rua: fix dereference of unset pointer

In the UNITDATA case, there is no map, so a) initialize map as NULL and b)
print the RUA ctx id directly from local var context_id instead.

Fixes: CID#181969
Change-Id: I73f508b719b61a389e10cbad1bafad1650634abe
---
M src/hnbgw_rua.c
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c
index e918c47..40d1d94 100644
--- a/src/hnbgw_rua.c
+++ b/src/hnbgw_rua.c
@@ -181,7 +181,7 @@
 {
 	struct msgb *msg;
 	struct osmo_scu_prim *prim;
-	struct hnbgw_context_map *map;
+	struct hnbgw_context_map *map = NULL;
 	struct hnbgw_cnlink *cn = hnb->gw->sccp.cnlink;
 	struct osmo_sccp_addr *remote_addr;
 	bool is_ps;
@@ -218,7 +218,7 @@
 		DEBUGP(DRUA, "rua_to_scu() %s to %s, rua_ctx_id %u (unitdata, no scu_conn_id)\n",
 		       cn_domain_indicator_to_str(cN_DomainIndicator),
 		       osmo_sccp_addr_dump(remote_addr),
-		       map->rua_ctx_id);
+		       context_id);
 		break;
 	default:
 		map = context_map_alloc_by_hnb(hnb, context_id, is_ps, cn);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I73f508b719b61a389e10cbad1bafad1650634abe
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