pespin submitted this change.
sigtran: Assert ss7 instance is found when msc->a.cs7_instance_valid == true
cs7_instance_valid is only set to true during VTY paths where
msc->a.cs7_instance was found and holds a valid pointer.
Hence, in that path osmo_ss7_instance_find(msc->a.cs7_instance) must
return a valid pointer too.
Later on in the same function, s7i was being used/dereferenced, and
coverity mentioned the possibility of it being NULL. The assert in the
path mentioned above fixes that possibility.
Related: Coverity CID#567671
Change-Id: If43c03f95c31aaec726057968a045623199b35d7
---
M src/osmo-bsc/osmo_bsc_sigtran.c
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c
index c91b725..8f566a4 100644
--- a/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -722,6 +722,7 @@
msc->a.cs7_instance_valid = true;
} else {
s7i = osmo_ss7_instance_find(msc->a.cs7_instance);
+ OSMO_ASSERT(s7i);
}
/* User didn't configure an 'msc-addr' in VTY for this msc, add
To view, visit change 44229. To unsubscribe, or for help writing mail filters, visit settings.