Change in libosmocore[master]: gsmtap_makemsg_ex: NULL for unknown chan_type

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

osmith gerrit-no-reply at lists.osmocom.org
Wed May 20 06:05:38 UTC 2020


osmith has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/18361 )

Change subject: gsmtap_makemsg_ex: NULL for unknown chan_type
......................................................................

gsmtap_makemsg_ex: NULL for unknown chan_type

Related: osmo-bts Ic22ab71e520ab44429a93724250d349d16250801
Change-Id: Ib4147a33a75c3cf425c30da8b0678c7fba8a371d
---
M src/gsmtap_util.c
1 file changed, 5 insertions(+), 1 deletion(-)

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



diff --git a/src/gsmtap_util.c b/src/gsmtap_util.c
index 9a0ac02..8674f1c 100644
--- a/src/gsmtap_util.c
+++ b/src/gsmtap_util.c
@@ -169,7 +169,8 @@
  *  \param[in] snr Signal/Noise Ratio (SNR)
  *  \param[in] data Pointer to data buffer
  *  \param[in] len Length of \ref data
- *  \return dynamically allocated message buffer containing data
+ *  \return dynamically allocated message buffer containing data,
+ *          or NULL for unknown chan_type
  *
  * This function will allocate a new msgb and fill it with a GSMTAP
  * header containing the information
@@ -182,6 +183,9 @@
 	struct gsmtap_hdr *gh;
 	uint8_t *dst;
 
+	if (chan_type == GSMTAP_CHANNEL_UNKNOWN)
+		return NULL;
+
 	msg = msgb_alloc(sizeof(*gh) + len, "gsmtap_tx");
 	if (!msg)
 		return NULL;

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ib4147a33a75c3cf425c30da8b0678c7fba8a371d
Gerrit-Change-Number: 18361
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
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/20200520/772c8c39/attachment.htm>


More information about the gerrit-log mailing list