Change in libosmocore[master]: gsm48_mi_to_string(): do not read from zero length input buffer

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

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Wed Dec 5 23:41:52 UTC 2018


Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/12157


Change subject: gsm48_mi_to_string(): do not read from zero length input buffer
......................................................................

gsm48_mi_to_string(): do not read from zero length input buffer

Change-Id: I12cada7c2c5187146ca5a33d1ebfefb4cad65632
---
M src/gsm/gsm48.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/57/12157/1

diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c
index 7517c09..68cb567 100644
--- a/src/gsm/gsm48.c
+++ b/src/gsm/gsm48.c
@@ -655,7 +655,7 @@
 	char *str_cur = string;
 	uint32_t tmsi;
 
-	mi_type = mi[0] & GSM_MI_TYPE_MASK;
+	mi_type = (mi && mi_len) ? (mi[0] & GSM_MI_TYPE_MASK) : GSM_MI_TYPE_NONE;
 
 	switch (mi_type) {
 	case GSM_MI_TYPE_TMSI:

-- 
To view, visit https://gerrit.osmocom.org/12157
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: I12cada7c2c5187146ca5a33d1ebfefb4cad65632
Gerrit-Change-Number: 12157
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181205/5d508020/attachment.htm>


More information about the gerrit-log mailing list