summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/src/mobile/gsm48_mm.c
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-11-02 16:57:49 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2017-11-05 23:41:42 +0700
commitb353686451a7372610a75cb5f8b89e79972d616a (patch)
treeaa3718820f99ec5d5ded8b967b202821cfde8e2c /src/host/layer23/src/mobile/gsm48_mm.c
parent37872f1032400ea5b1223c79128f7d6bbe002507 (diff)
mobile/gsm48_mm.c: use secure gsm_7bit_decode_n
Since some 'gsm_7bit_*' functions were deprecated and replaced by more secure ones with the '_n_' postfix in names, it's better to use the updated functions. Change-Id: I4499b592a0dfea71462aed19fe641419d79b3cbd
Diffstat (limited to 'src/host/layer23/src/mobile/gsm48_mm.c')
-rw-r--r--src/host/layer23/src/mobile/gsm48_mm.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/host/layer23/src/mobile/gsm48_mm.c b/src/host/layer23/src/mobile/gsm48_mm.c
index 100129bb..360f9b32 100644
--- a/src/host/layer23/src/mobile/gsm48_mm.c
+++ b/src/host/layer23/src/mobile/gsm48_mm.c
@@ -264,10 +264,7 @@ static int decode_network_name(char *name, int name_len,
length = ((in_len - 1) * 8 - padding) / 7;
if (length <= 0)
return 0;
- if (length >= name_len)
- length = name_len - 1;
- gsm_7bit_decode(name, lv + 2, length);
- name[length] = '\0';
+ gsm_7bit_decode_n(name, name_len, lv + 2, length);
return length;
}