提交 39bbcaff authored 作者: Travis Cross's avatar Travis Cross

Avoid crash on event without content-type

If we received an event without a content-type header we were
dereferencing a null pointer leading to a seg fault.
Reported-by: 's avatarIco <ico@voip-io.org>

ESL-90 --resolve
上级 44252650
......@@ -1556,7 +1556,7 @@ ESL_DECLARE(esl_status_t) esl_send_recv_timed(esl_handle_t *handle, const char *
if (handle->last_sr_event) {
char *ct = esl_event_get_header(handle->last_sr_event,"content-type");
if (strcasecmp(ct, "api/response") && strcasecmp(ct, "command/reply")) {
if (ct && strcasecmp(ct, "api/response") && strcasecmp(ct, "command/reply")) {
esl_event_t *ep;
for(ep = handle->race_event; ep && ep->next; ep = ep->next);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论