summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gsm/gsm48.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c
index af3e14c5..190622ff 100644
--- a/src/gsm/gsm48.c
+++ b/src/gsm/gsm48.c
@@ -655,7 +655,7 @@ int gsm48_mi_to_string(char *string, const int str_len, const uint8_t *mi,
uint8_t mi_type;
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: