]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Avoid crash on event without content-type
authorTravis Cross <tc@traviscross.com>
Wed, 9 Apr 2014 01:16:12 +0000 (01:16 +0000)
committerTravis Cross <tc@traviscross.com>
Wed, 9 Apr 2014 05:30:22 +0000 (05:30 +0000)
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

libs/esl/src/esl.c

index bbb6c51aec838e9709600b0e874ad1f1c0a14f8f..28c8927b6fa0f4a52b8830648a991da64f41f542 100644 (file)
@@ -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);