[mod_voicemail_ivr] Fix array overflow

This commit is contained in:
Chris Rienzo 2021-11-01 13:50:26 +00:00
parent 9f26a15220
commit 5cd8a53ae8
1 changed files with 3 additions and 1 deletions

View File

@ -730,13 +730,15 @@ char *vmivr_menu_get_input_set(switch_core_session_t *session, vmivr_profile_t *
for (retry = menu->ivr_maximum_attempts; switch_channel_ready(channel) && retry > 0; retry--) {
int i;
int dtmfa_array_length = 0;
menu_instance_init(menu);
switch_event_add_header(menu->phrase_params, SWITCH_STACK_BOTTOM, "IVR-Retry-Left", "%d", retry);
/* Find the last entry and append this one to it */
for (i=0; i < 16 && menu->dtmfa[i]; i++){
dtmfa_array_length = sizeof(menu->dtmfa) / sizeof(menu->dtmfa[0]);
for (i = 0; i < (dtmfa_array_length - 1) && menu->dtmfa[i]; i++){
}
menu->dtmfa[i] = (char *) input_mask;