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

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

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu May 9 12:23:39 UTC 2019


Neels Hofmeyr has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/39/13939/1

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: newchange
Gerrit-Change-Id: Icd146ae512236a09cad080ed3eb85944e8f5cee4
Gerrit-Change-Number: 13939
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190509/dd1d974d/attachment.htm>


More information about the gerrit-log mailing list