mobile/gsm322.c: prevent buffer over-/under-run
Change-Id: Ic12587a6c6456b8663e5357cf68a22c6d1927a07
This commit is contained in:
parent
43ecde0fce
commit
3483d4d844
|
@ -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 "";
|
||||
|
|
Loading…
Reference in New Issue