提交 4e888a28 authored 作者: Michael Jerris's avatar Michael Jerris

CID:1214196 Dereference null return value, if we hit this condition, something…

CID:1214196 Dereference null return value, if we hit this condition, something very bad has happened, we should never have the private not set if we get to the hangup hook, log error instead of crashing
上级 d2884ac5
......@@ -59,6 +59,11 @@ static switch_status_t spy_on_hangup(switch_core_session_t *session)
const char *uuid = switch_core_session_get_uuid(session);
spy_t *spy = NULL, *p = NULL, *prev = NULL;
if (!data) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Can't call mod_spy hangup hook due to missing private data\n");
return SWITCH_STATUS_SUCCESS;
}
switch_thread_rwlock_wrlock(globals.spy_hash_lock);
spy = switch_core_hash_find(globals.spy_hash, data);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论