提交 6d8edab5 authored 作者: Mark Lipscombe's avatar Mark Lipscombe 提交者: Michael Jerris

FS-8413: Segfault calling session:getVariable(nil) in lua script

script calling session:getVariable() with a null variable
name will cause FreeSWITCH to segfault.

This change checks whether varname parameter to
switch_channel_get_variable_dup is non-NULL.
上级 0e551408
......@@ -930,6 +930,7 @@ SWITCH_DECLARE(const char *) switch_channel_get_variable_dup(switch_channel_t *c
switch_mutex_lock(channel->profile_mutex);
if (!zstr(varname)) {
if (channel->scope_variables) {
switch_event_t *ep;
......@@ -959,6 +960,7 @@ SWITCH_DECLARE(const char *) switch_channel_get_variable_dup(switch_channel_t *c
}
}
}
}
if (dup && v != vdup) {
if (v) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论