diff --git a/libs/esl/src/esl.c b/libs/esl/src/esl.c index 923ae966f4..01a27f490e 100644 --- a/libs/esl/src/esl.c +++ b/libs/esl/src/esl.c @@ -1459,7 +1459,7 @@ ESL_DECLARE(esl_status_t) esl_recv_event(esl_handle_t *handle, int check_q, esl_ } } - if ((cl = esl_event_get_header(handle->last_ievent, "content-length"))) { + if (beg && (cl = esl_event_get_header(handle->last_ievent, "content-length"))) { handle->last_ievent->body = strdup(beg); } diff --git a/libs/esl/src/esl_buffer.c b/libs/esl/src/esl_buffer.c index 6095a56a21..ac4247791b 100644 --- a/libs/esl/src/esl_buffer.c +++ b/libs/esl/src/esl_buffer.c @@ -176,6 +176,7 @@ ESL_DECLARE(esl_size_t) esl_buffer_read(esl_buffer_t *buffer, void *data, esl_si esl_assert(buffer != NULL); esl_assert(data != NULL); + esl_assert(buffer->head != NULL); if (buffer->used < 1) { diff --git a/libs/esl/src/esl_event.c b/libs/esl/src/esl_event.c index ae01575251..75a456c861 100644 --- a/libs/esl/src/esl_event.c +++ b/libs/esl/src/esl_event.c @@ -549,6 +549,7 @@ static esl_status_t esl_event_base_add_header(esl_event_t *event, esl_stack_t st redraw: len = 0; for(j = 0; j < header->idx; j++) { + esl_assert(header->array[j]); len += strlen(header->array[j]) + 2; } @@ -835,12 +836,10 @@ ESL_DECLARE(esl_status_t) esl_event_serialize(esl_event_t *event, char **str, es if ((len + llen) > dlen) { char *m; - char *old = buf; dlen += (blocksize + (len + llen)); if ((m = realloc(buf, dlen))) { buf = m; } else { - buf = old; abort(); } } @@ -864,12 +863,10 @@ ESL_DECLARE(esl_status_t) esl_event_serialize(esl_event_t *event, char **str, es if ((len + llen) > dlen) { char *m; - char *old = buf; dlen += (blocksize + (len + llen)); if ((m = realloc(buf, dlen))) { buf = m; } else { - buf = old; abort(); } }