[PATCH] libosmocore[master]: gsm0480: skip length check for 'RELEASE COMPLETE' message

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
Wed Jan 10 17:34:48 UTC 2018


Hello Harald Welte, Jenkins Builder,

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

    https://gerrit.osmocom.org/3373

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

gsm0480: skip length check for 'RELEASE COMPLETE' message

According to GSM 04.80 Section 2.5 'Release complete' Table 2.5,
the 'RELEASE COMPLETE' message payload is optional, so let's drop
length check in gsm0480_decode_ss_request() for this type.

Change-Id: I63b7f8ce403169a9dbdbdb031db16693de2196d6
---
M src/gsm/gsm0480.c
1 file changed, 10 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/73/3373/6

diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c
index ae82f46..45808c9 100644
--- a/src/gsm/gsm0480.c
+++ b/src/gsm/gsm0480.c
@@ -253,11 +253,18 @@
 int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len,
 				struct gsm0480_ss_request *req)
 {
+	uint8_t msg_type = hdr->msg_type & 0x3F;
 	int rc = 0;
 
-	if (len < sizeof(*hdr) + 2) {
-		LOGP(0, LOGL_DEBUG, "SS Request is too short.\n");
-		return 0;
+	/**
+	 * GSM 04.80 Section 2.5 'Release complete' Table 2.5
+	 * payload is optional for 'RELEASE COMPLETE' message
+	 */
+	if (msg_type != GSM0480_MTYPE_RELEASE_COMPLETE) {
+		if (len < sizeof(*hdr) + 2) {
+			LOGP(0, LOGL_DEBUG, "SS Request is too short.\n");
+			return 0;
+		}
 	}
 
 	if (gsm48_hdr_pdisc(hdr) == GSM48_PDISC_NC_SS) {

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I63b7f8ce403169a9dbdbdb031db16693de2196d6
Gerrit-PatchSet: 6
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Alexander Chemeris <Alexander.Chemeris at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list