summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-11-08 18:35:08 +0700
committerHarald Welte <laforge@gnumonks.org>2017-11-09 03:46:41 +0000
commit3483d4d8447de3a0177204e4c8b74daa57f02cda (patch)
tree66a6291d09544ffb711dc8cf0f702302a5a59b31
parent43ecde0fced685bc5b4fa4818df36a6bc394df59 (diff)
mobile/gsm322.c: prevent buffer over-/under-run
-rw-r--r--src/host/layer23/src/mobile/gsm322.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/host/layer23/src/mobile/gsm322.c b/src/host/layer23/src/mobile/gsm322.c
index 0e2c9afe..91729d87 100644
--- a/src/host/layer23/src/mobile/gsm322.c
+++ b/src/host/layer23/src/mobile/gsm322.c
@@ -320,6 +320,9 @@ static char *bargraph(int value, int min, int max)
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 "";