summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorInstallation Owner <owner@lobotron>2017-07-26 16:44:59 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2017-07-31 11:56:03 +0200
commit738756984f2479512514515e95610f0a1bde7bd1 (patch)
tree2ae784ad60c5ec6067116c5f122cf213efb9d50b
parentb06c887cf0ae8b0dd15f93f85459cf903f3b145b (diff)
sccp: fix possible nullpointer deref
check input parameters local_ip and remote_ip of the function osmo_sccp_simple_client_on_ss7_id() before using them with talloc_strdup() Change-Id: I1a5dd1ea3167513bf9e7ae153f83e1ae3136c905
-rw-r--r--src/sccp_user.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sccp_user.c b/src/sccp_user.c
index c9443a2..89a0320 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -331,8 +331,10 @@ osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name,
goto out_rt;
asp_created = true;
- asp->cfg.local.host = talloc_strdup(asp, local_ip);
- asp->cfg.remote.host = talloc_strdup(asp, remote_ip);
+ local_ip ? asp->cfg.local.host =
+ talloc_strdup(asp, local_ip) : NULL;
+ remote_ip ? asp->cfg.remote.host =
+ talloc_strdup(asp, remote_ip) : NULL;
osmo_ss7_as_add_asp(as, asp->cfg.name);
}