[mod_rayo] Fix heap use after free and a possible buffer overflow.

This commit is contained in:
Andrey Volk 2020-01-20 00:20:30 +04:00
parent 7effdf0565
commit 852e4a9471
2 changed files with 2 additions and 2 deletions

View File

@ -4854,7 +4854,7 @@ static int alias_api(struct rayo_cmd_alias *alias, char *args, switch_stream_han
cmd = strdup(alias->cmd);
for (i = 1; i < argc; i++) {
char *cmd_new;
char to_replace[4] = { 0 };
char to_replace[12] = { 0 };
sprintf(to_replace, "$%i", i);
cmd_new = switch_string_replace(cmd, to_replace, argv[i]);
free(cmd);

View File

@ -851,8 +851,8 @@ static void srgs_grammar_destroy(struct srgs_grammar *grammar)
if (grammar->jsgf_file_name) {
switch_file_remove(grammar->jsgf_file_name, pool);
}
switch_core_destroy_memory_pool(&pool);
switch_core_hash_destroy(&grammar->rules);
switch_core_destroy_memory_pool(&pool);
}
/**