Change in libosmocore[master]: libosmogsm/gsup.c: assert message type in osmo_gsup_encode()

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

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Fri Oct 12 09:10:07 UTC 2018


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/11325


Change subject: libosmogsm/gsup.c: assert message type in osmo_gsup_encode()
......................................................................

libosmogsm/gsup.c: assert message type in osmo_gsup_encode()

Missing (unset) type of to be encoded message is not a memory
allocation failure (-ENOMEM), this is definitely a mistake.

Change-Id: Ibbac18e2b68b765c17c2bc959c4c085037953a7f
---
M src/gsm/gsup.c
1 file changed, 1 insertion(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/25/11325/1

diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c
index 9c2f817..fe13d95 100644
--- a/src/gsm/gsup.c
+++ b/src/gsm/gsup.c
@@ -534,9 +534,7 @@
 	size_t bcd_len;
 
 	/* generic part */
-	if(!gsup_msg->message_type)
-		return -ENOMEM;
-
+	OSMO_ASSERT(gsup_msg->message_type != 0x00);
 	msgb_v_put(msg, gsup_msg->message_type);
 
 	bcd_len = gsm48_encode_bcd_number(bcd_buf, sizeof(bcd_buf), 0,

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibbac18e2b68b765c17c2bc959c4c085037953a7f
Gerrit-Change-Number: 11325
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181012/f19ca1fc/attachment.htm>


More information about the gerrit-log mailing list