mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-05-01 14:23:42 +00:00
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.
This commit is contained in:
parent
cffc673879
commit
6288af5ef1
@ -944,6 +944,7 @@ SWITCH_DECLARE(const char *) switch_channel_get_variable_dup(switch_channel_t *c
|
|||||||
|
|
||||||
switch_mutex_lock(channel->profile_mutex);
|
switch_mutex_lock(channel->profile_mutex);
|
||||||
|
|
||||||
|
if (!zstr(varname)) {
|
||||||
if (channel->scope_variables) {
|
if (channel->scope_variables) {
|
||||||
switch_event_t *ep;
|
switch_event_t *ep;
|
||||||
|
|
||||||
@ -973,6 +974,7 @@ SWITCH_DECLARE(const char *) switch_channel_get_variable_dup(switch_channel_t *c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (dup && v != vdup) {
|
if (dup && v != vdup) {
|
||||||
if (v) {
|
if (v) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user