From f754057c2a1450ad2ec1490ea9dfc3bf5abbd337 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 4f85c80212..3421717e91 100644 --- a/libs/esl/src/esl.c +++ b/libs/esl/src/esl.c @@ -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);