osmith has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-bsc-nat/+/28581 )
Change subject: bsc_nat_print_addr: handle NULL
......................................................................
bsc_nat_print_addr: handle NULL
Fixes: Coverity CID#273006, CID#273005
Fixes: OS#5597
Change-Id: I37cfc7ae32d85142d73b523b2f13b94a0bffba7a
---
M src/osmo-bsc-nat/bsc_nat.c
M src/osmo-bsc-nat/bsc_nat_fsm.c
2 files changed, 7 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc-nat refs/changes/81/28581/1
diff --git a/src/osmo-bsc-nat/bsc_nat.c b/src/osmo-bsc-nat/bsc_nat.c
index 3ae7881..61083ac 100644
--- a/src/osmo-bsc-nat/bsc_nat.c
+++ b/src/osmo-bsc-nat/bsc_nat.c
@@ -98,6 +98,11 @@
{
static char buf[25];
+ if (!addr) {
+ snprintf(buf, sizeof(buf), "(addr == NULL)");
+ return buf;
+ }
+
snprintf(buf, sizeof(buf), "PC=%s in %s", osmo_ss7_pointcode_print(NULL,
addr->pc),
net == BSC_NAT_NET_CN ? "CN" : "RAN");
diff --git a/src/osmo-bsc-nat/bsc_nat_fsm.c b/src/osmo-bsc-nat/bsc_nat_fsm.c
index d7f8aa3..96f1564 100644
--- a/src/osmo-bsc-nat/bsc_nat_fsm.c
+++ b/src/osmo-bsc-nat/bsc_nat_fsm.c
@@ -80,7 +80,7 @@
{
struct bsc_nat_sccp_inst *sccp_inst = osmo_sccp_user_get_priv(scu);
struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph;
- struct osmo_sccp_addr *addr; /* MSC's address */
+ struct osmo_sccp_addr *addr = NULL; /* MSC's address */
struct subscr_conn *subscr_conn;
int rc = -1;
@@ -170,7 +170,7 @@
{
struct bsc_nat_sccp_inst *sccp_inst = osmo_sccp_user_get_priv(scu);
struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph;
- struct osmo_sccp_addr *addr; /* BSC's address */
+ struct osmo_sccp_addr *addr = NULL; /* BSC's address */
struct subscr_conn *subscr_conn;
struct msc *msc;
struct bsc *bsc;
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bsc-nat/+/28581
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc-nat
Gerrit-Branch: master
Gerrit-Change-Id: I37cfc7ae32d85142d73b523b2f13b94a0bffba7a
Gerrit-Change-Number: 28581
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange