Browse Source

TT#108003 Fix off-by-one check dtmf_samples()

The dtmf_freqs array contains one less element than the check was
allowing for.

Change-Id: I783fa6bcd0bd79fad9886ee53e7a990e504ecff8
Warned-by: coverity
pull/1194/head
Guillem Jover 5 years ago
parent
commit
6d51b3afc7
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      lib/dtmflib.c

+ 1
- 1
lib/dtmflib.c View File

@ -47,7 +47,7 @@ void dtmf_samples(void *buf, unsigned long offset, unsigned long num, unsigned i
return;
}
if (event > G_N_ELEMENTS(dtmf_freqs)) {
if (event >= G_N_ELEMENTS(dtmf_freqs)) {
ilog(LOG_WARN | LOG_FLAG_LIMIT, "Unsupported DTMF event %u", event);
memset(buf, 0, num * 2);
return;


Loading…
Cancel
Save