[PATCH] osmocom-bb[master]: mobile/gsm322.c: prevent buffer over-/under-run

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 Nov 8 11:35:54 UTC 2017


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

mobile/gsm322.c: prevent buffer over-/under-run

Change-Id: Ic12587a6c6456b8663e5357cf68a22c6d1927a07
---
M src/host/layer23/src/mobile/gsm322.c
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/29/4729/1

diff --git a/src/host/layer23/src/mobile/gsm322.c b/src/host/layer23/src/mobile/gsm322.c
index 887a0ee..b1e0362 100644
--- a/src/host/layer23/src/mobile/gsm322.c
+++ b/src/host/layer23/src/mobile/gsm322.c
@@ -322,6 +322,9 @@
 	else
 		value -= min;
 
+	/* Prevent 'bar' buffer over-/under-run */
+	OSMO_ASSERT(value > 0 && value < 128);
+
 	/* Prevent calling memset() with zero length */
 	if (value == 0)
 		return "";

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic12587a6c6456b8663e5357cf68a22c6d1927a07
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