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: Ico <ico@voip-io.org>

ESL-90 --resolve
This commit is contained in:
Travis Cross 2014-04-09 01:16:12 +00:00
parent c6acddf928
commit f754057c2a
1 changed files with 1 additions and 1 deletions

View File

@ -1567,7 +1567,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);