From 39bbcaff1bab83e0b6147b65d1ce4a1ab4c7cd5a Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Wed, 9 Apr 2014 01:16:12 +0000 Subject: [PATCH] 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 ESL-90 --resolve --- libs/esl/src/esl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/esl/src/esl.c b/libs/esl/src/esl.c index bbb6c51aec..28c8927b6f 100644 --- a/libs/esl/src/esl.c +++ b/libs/esl/src/esl.c @@ -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);