mirror of git://git.sysmocom.de/ofono
stk: Fix potential buffer overrun
This commit is contained in:
parent
bdda846134
commit
87932a536f
|
@ -2618,7 +2618,7 @@ static gboolean handle_command_play_tone(const struct stk_command *cmd,
|
||||||
int timeout;
|
int timeout;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (pt->tone > sizeof(tone_infos) / sizeof(*tone_infos) ||
|
if (pt->tone >= L_ARRAY_SIZE(tone_infos) ||
|
||||||
tone_infos[pt->tone].name == NULL) {
|
tone_infos[pt->tone].name == NULL) {
|
||||||
rsp->result.type = STK_RESULT_TYPE_DATA_NOT_UNDERSTOOD;
|
rsp->result.type = STK_RESULT_TYPE_DATA_NOT_UNDERSTOOD;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue