pespin submitted this change.
sigtran: Avoid potential uninitialized ptr dereference
Use osmo_sccp_addr_dump() instead of osmo_sccp_addr_name(), since msc
may be uninitialized and hence ss7 may not be available.
Change-Id: I682567e88f61c9ec3cfa25c50f2c12fc9d1f6e4f
---
M src/osmo-bsc/osmo_bsc_sigtran.c
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c
index 42e9a38..bfe9817 100644
--- a/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -97,15 +97,13 @@
/* Find an MSC by its remote SCCP address */
static struct bsc_msc_data *get_msc_by_addr(const struct osmo_sccp_addr *msc_addr)
{
- struct osmo_ss7_instance *ss7;
struct bsc_msc_data *msc;
llist_for_each_entry(msc, msc_list, entry) {
if (memcmp(msc_addr, &msc->a.msc_addr, sizeof(*msc_addr)) == 0)
return msc;
}
-
- ss7 = osmo_ss7_instance_find(msc->a.cs7_instance);
- LOGP(DMSC, LOGL_ERROR, "Unable to find MSC data under address: %s\n", osmo_sccp_addr_name(ss7, msc_addr));
+ LOGP(DMSC, LOGL_ERROR, "Unable to find MSC data under address: %s\n",
+ osmo_sccp_addr_dump(msc_addr));
return NULL;
}
To view, visit change 40704. To unsubscribe, or for help writing mail filters, visit settings.