[PATCH] libosmo-sccp[master]: osmo_ss7_user_unregister(): Don't dereference NULL user

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
Thu Apr 27 10:35:35 UTC 2017


Review at  https://gerrit.osmocom.org/2439

osmo_ss7_user_unregister(): Don't dereference NULL user

The 'user' argument to osmo_ss7_user_unregister() can be NULL, so let's
make sure we don't dereference it.

Change-Id: Ia34b181dcbcb179b2639e2f405364cc952069842
Fixes: coverity CID#166933
---
M src/osmo_ss7.c
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/39/2439/1

diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index 31c0dc5..d952ecd 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -442,7 +442,8 @@
 	if (user && (inst->user[service_ind] != user))
 		return -EINVAL;
 
-	user->inst = NULL;
+	if (user)
+		user->inst = NULL;
 	inst->user[service_ind] = NULL;
 
 	return 0;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia34b181dcbcb179b2639e2f405364cc952069842
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list