From: Travis Cross Date: Wed, 9 Apr 2014 01:16:12 +0000 (+0000) Subject: Avoid crash on event without content-type X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39bbcaff1bab83e0b6147b65d1ce4a1ab4c7cd5a;p=thirdparty%2Ffreeswitch.git 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 --- 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);