Merge pull request #1420 from signalwire/voicemail-ivr-overflow

[mod_voicemail_ivr] Fix array overflow
This commit is contained in:
Andrey Volk 2021-12-28 17:07:45 +03:00 committed by GitHub
commit de70d9d493
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;