[PATCH] osmocom-bb[master]: mobile/gsm48_mm.c: use secure gsm_7bit_decode_n

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
Thu Nov 2 10:54:36 UTC 2017


Review at  https://gerrit.osmocom.org/4642

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
---
M src/host/layer23/src/mobile/gsm48_mm.c
1 file changed, 1 insertion(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/42/4642/1

diff --git a/src/host/layer23/src/mobile/gsm48_mm.c b/src/host/layer23/src/mobile/gsm48_mm.c
index 100129b..360f9b3 100644
--- a/src/host/layer23/src/mobile/gsm48_mm.c
+++ b/src/host/layer23/src/mobile/gsm48_mm.c
@@ -264,10 +264,7 @@
 	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;
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4499b592a0dfea71462aed19fe641419d79b3cbd
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>



More information about the gerrit-log mailing list