提交 c01a8849 authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-8720 #resolve [Segmentation Fault when switch_channel_str2cause is called]

上级 4fc4c523
...@@ -204,8 +204,9 @@ SWITCH_DECLARE(const char *) switch_channel_cause2str(switch_call_cause_t cause) ...@@ -204,8 +204,9 @@ SWITCH_DECLARE(const char *) switch_channel_cause2str(switch_call_cause_t cause)
SWITCH_DECLARE(switch_call_cause_t) switch_channel_str2cause(const char *str) SWITCH_DECLARE(switch_call_cause_t) switch_channel_str2cause(const char *str)
{ {
uint8_t x; uint8_t x;
switch_call_cause_t cause = SWITCH_CAUSE_NONE; switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
if (!zstr(str)) {
if (*str > 47 && *str < 58) { if (*str > 47 && *str < 58) {
cause = atoi(str); cause = atoi(str);
} else { } else {
...@@ -216,6 +217,8 @@ SWITCH_DECLARE(switch_call_cause_t) switch_channel_str2cause(const char *str) ...@@ -216,6 +217,8 @@ SWITCH_DECLARE(switch_call_cause_t) switch_channel_str2cause(const char *str)
} }
} }
} }
}
return cause; return cause;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论