[PATCH] osmocom-bb[master]: mobile/gsm322.c: prevent calling memset with n <= 0

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:37 UTC 2017


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

mobile/gsm322.c: prevent calling memset with n <= 0

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


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/45/4645/1

diff --git a/src/host/layer23/src/mobile/gsm322.c b/src/host/layer23/src/mobile/gsm322.c
index ad6a83b..4b39924 100644
--- a/src/host/layer23/src/mobile/gsm322.c
+++ b/src/host/layer23/src/mobile/gsm322.c
@@ -322,7 +322,9 @@
 	else
 		value -= min;
 
-	memset(bar, '=', value);
+	if (value >= 0)
+		memset(bar, '=', value);
+
 	bar[value] = '\0';
 
 	return bar;

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

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