From 87932a536fb0425c2c33cf62775fd9ccb1bf8393 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Mon, 29 Apr 2019 19:24:19 -0500 Subject: [PATCH] stk: Fix potential buffer overrun --- src/stk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stk.c b/src/stk.c index 0ba43844..6859bb91 100644 --- a/src/stk.c +++ b/src/stk.c @@ -2618,7 +2618,7 @@ static gboolean handle_command_play_tone(const struct stk_command *cmd, int timeout; 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) { rsp->result.type = STK_RESULT_TYPE_DATA_NOT_UNDERSTOOD;