[MERGED] libosmo-sccp[master]: sccp: fix possible nullpointer deref

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue Aug 1 10:23:08 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: sccp: fix possible nullpointer deref
......................................................................


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
---
M src/sccp_user.c
1 file changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



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 @@
 			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);
 	}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1a5dd1ea3167513bf9e7ae153f83e1ae3136c905
Gerrit-PatchSet: 3
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list