[PATCH] osmo-bts[master]: OML: Fixup for CID 159533 Null pointer dereferences (NULL_RE...

dexter gerrit-no-reply at lists.osmocom.org
Tue Jan 10 09:46:33 UTC 2017

Hello Neels Hofmeyr, Jenkins Builder,

I'd like you to reexamine a change.  Please visit


to look at the new patch set (#3).

OML: Fixup for CID 159533 Null pointer dereferences (NULL_RETURNS)

oml_ipa_set_attr() is using gsm_objclass2mo() to determine the
*mo object. However it is possible that gsm_objclass2mo() a
null-pointer. The code following up is using *mo without checking.
This commit adds an additional check to ensure that *mo is not
used without checking.

Change-Id: Ia2cc9bc504c46ca3843c43d712cd8649bfae9526
M src/common/oml.c
1 file changed, 2 insertions(+), 0 deletions(-)

  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/46/1546/3

diff --git a/src/common/oml.c b/src/common/oml.c
index 8ccfcc6..88c9abd 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -1048,6 +1048,8 @@
 	rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh));
 	if (rc < 0) {
 		mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst);
+		if (!mo)
+			return oml_fom_ack_nack(msg, NM_NACK_OBJINST_UNKN);
 		oml_tx_failure_event_rep(mo, OSMO_EVT_MAJ_UNSUP_ATTR,
 					 "New value for IPAC Set Attribute not "

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia2cc9bc504c46ca3843c43d712cd8649bfae9526
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>

More information about the gerrit-log mailing list