Change in osmo-msc[master]: make msc_a_vsub() and others NULL-safe

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri May 10 07:04:52 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13939 )

Change subject: make msc_a_vsub() and others NULL-safe
......................................................................

make msc_a_vsub() and others NULL-safe

Fixes: coverity CID 198451
Change-Id: Icd146ae512236a09cad080ed3eb85944e8f5cee4
---
M src/libmsc/msc_a.c
M src/libmsc/msc_i.c
M src/libmsc/msc_t.c
3 files changed, 10 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c
index 675f932..5baed54 100644
--- a/src/libmsc/msc_a.c
+++ b/src/libmsc/msc_a.c
@@ -73,16 +73,22 @@
 
 struct vlr_subscr *msc_a_vsub(const struct msc_a *msc_a)
 {
+	if (!msc_a)
+		return NULL;
 	return msub_vsub(msc_a->c.msub);
 }
 
 struct msc_i *msc_a_msc_i(const struct msc_a *msc_a)
 {
+	if (!msc_a)
+		return NULL;
 	return msub_msc_i(msc_a->c.msub);
 }
 
 struct msc_t *msc_a_msc_t(const struct msc_a *msc_a)
 {
+	if (!msc_a)
+		return NULL;
 	return msub_msc_t(msc_a->c.msub);
 }
 
diff --git a/src/libmsc/msc_i.c b/src/libmsc/msc_i.c
index 6badba6..05df9cb 100644
--- a/src/libmsc/msc_i.c
+++ b/src/libmsc/msc_i.c
@@ -332,6 +332,8 @@
 
 struct vlr_subscr *msc_i_vsub(const struct msc_i *msc_i)
 {
+	if (!msc_i)
+		return NULL;
 	return msub_vsub(msc_i->c.msub);
 }
 
diff --git a/src/libmsc/msc_t.c b/src/libmsc/msc_t.c
index ec5531f..c6bba47 100644
--- a/src/libmsc/msc_t.c
+++ b/src/libmsc/msc_t.c
@@ -902,6 +902,8 @@
 
 struct vlr_subscr *msc_t_vsub(const struct msc_t *msc_t)
 {
+	if (!msc_t)
+		return NULL;
 	return msub_vsub(msc_t->c.msub);
 }
 

-- 
To view, visit https://gerrit.osmocom.org/13939
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Icd146ae512236a09cad080ed3eb85944e8f5cee4
Gerrit-Change-Number: 13939
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190510/224f3da2/attachment.html>


More information about the gerrit-log mailing list