Merge pull request #240 from signalwire/mod_rayo_heap
[mod_rayo] Fix heap use after free and a possible buffer overflow.
This commit is contained in:
commit
3fb5df00fb
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue