diff options
author | George Joseph <gjoseph@digium.com> | 2017-05-04 15:04:46 -0600 |
---|---|---|
committer | George Joseph <gjoseph@digium.com> | 2017-05-04 19:09:33 -0600 |
commit | bed6c0d04b71ce404adc9a75835a5a20cbc143bd (patch) | |
tree | 90be82d7b1dce87431d37ea90b72fb9f2a599665 /main | |
parent | 1d44c838d8300ec4fad40f293045a13ce7522841 (diff) |
app_confbridge: Fix reference to cfg in menu_template_handler
menu_template_handler wasn't properly accounting for the fact that
it might be called both during a load/reload (which isn't really
valid but not prevented) and by a dialplan function. In both cases
it was attempting to use the "pending" config which wasn't valid in
the latter case. aco_process_config is also partly to blame because
it wasn't properly cleaning "pending" up when a reload was done and
no changes were made. Both of these contributed to a crash if
CONFBRIDGE(menu,template) was called in a dialplan after a reload.
* aco_process_config now sets info->internal->pending to NULL
after it unrefs it although this isn't strictly necessary in the
context of this fix.
* menu_template_handler now uses the "current" config and silently
ignores any attempt to be called as a result of someone uses the
"template" parameter in the conf file.
Luckily there's no other place in the codebase where
aco_pending_config is used outside of aco_process_config.
ASTERISK-25506 #close
Reported-by: Frederic LE FOLL
Change-Id: Ib349a17d3d088f092480b19addd7122fcaac21a7
Diffstat (limited to 'main')
-rw-r--r-- | main/config_options.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/main/config_options.c b/main/config_options.c index cc8e218f8..81d0ff9a0 100644 --- a/main/config_options.c +++ b/main/config_options.c @@ -588,10 +588,13 @@ enum aco_process_status aco_process_ast_config(struct aco_info *info, struct aco }; ao2_cleanup(info->internal->pending); + info->internal->pending = NULL; return ACO_PROCESS_OK; error: ao2_cleanup(info->internal->pending); + info->internal->pending = NULL; + return ACO_PROCESS_ERROR; } @@ -704,6 +707,8 @@ try_alias: end: ao2_cleanup(info->internal->pending); + info->internal->pending = NULL; + return res; } int aco_process_var(struct aco_type *type, const char *cat, struct ast_variable *var, void *obj) |