Change in osmo-bsc[master]: bsc_subscr_find_or_create_by_{imsi, tmsi}(): fix NULL pointer dereference

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

laforge gerrit-no-reply at lists.osmocom.org
Fri May 29 20:01:10 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/18558 )

Change subject: bsc_subscr_find_or_create_by_{imsi,tmsi}(): fix NULL pointer dereference
......................................................................

bsc_subscr_find_or_create_by_{imsi,tmsi}(): fix NULL pointer dereference

Change-Id: Icb89d566b51031c2296be0888f8b7e554aa50418
---
M src/osmo-bsc/bsc_subscriber.c
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/osmo-bsc/bsc_subscriber.c b/src/osmo-bsc/bsc_subscriber.c
index 2541883..38b532a 100644
--- a/src/osmo-bsc/bsc_subscriber.c
+++ b/src/osmo-bsc/bsc_subscriber.c
@@ -90,6 +90,8 @@
 	if (bsub)
 		return bsub;
 	bsub = bsc_subscr_alloc(list);
+	if (!bsub)
+		return NULL;
 	bsc_subscr_set_imsi(bsub, imsi);
 	return bsc_subscr_get(bsub);
 }
@@ -102,6 +104,8 @@
 	if (bsub)
 		return bsub;
 	bsub = bsc_subscr_alloc(list);
+	if (!bsub)
+		return NULL;
 	bsub->tmsi = tmsi;
 	return bsc_subscr_get(bsub);
 }

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18558
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Icb89d566b51031c2296be0888f8b7e554aa50418
Gerrit-Change-Number: 18558
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200529/df39ed84/attachment.htm>


More information about the gerrit-log mailing list