add better bounds checking in dtmf_accepting array to avoid buffer overrun in mod_voicemail_ivr

This commit is contained in:
Michael Jerris 2014-04-30 13:31:06 -04:00
parent a9a852477a
commit 0b8d2c5d65
2 changed files with 3 additions and 3 deletions

View File

@ -41,10 +41,10 @@ static int match_dtmf(switch_core_session_t *session, ivre_data_t *loc) {
loc->completeMatch = NULL;
loc->potentialMatchCount = 0;
for (i = 0; i < loc->dtmf_received; i++) {
for (i = 0; i < 16 && i < loc->dtmf_received; i++) {
int j;
loc->potentialMatchCount = 0;
for (j = 0; !zstr(loc->dtmf_accepted[j]) && j < 128; j++) {
for (j = 0; j < 128 && !zstr(loc->dtmf_accepted[j]); j++) {
switch_bool_t cMatch = SWITCH_FALSE;
char test[2] = { 0 };

View File

@ -36,7 +36,7 @@
struct ivre_data {
char dtmf_stored[128];
int dtmf_received;
char dtmf_accepted[16][128];
char dtmf_accepted[128][16];
int result;
switch_bool_t audio_stopped;
switch_bool_t recorded_audio;