kore

Kore is a web application platform for writing scalable, concurrent web based processes in C or Python.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

commit e4e9a2f81edd19812da4442634a62912497a410c
parent 5228fe1cbc695e98e957c72f93f5b966cfb2417a
Author: Joris Vink <joris@coders.se>
Date:   Tue, 19 May 2015 06:35:08 +0200

Merge pull request #58 from QuentinPerez/fix-null-dereference

fix-null-dereference
Diffstat:
src/http.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/http.c b/src/http.c @@ -1211,7 +1211,7 @@ http_response_spdy(struct http_request *req, struct connection *c, net_send_queue(c, d, len, s, NETBUF_LAST_CHAIN); } - if (req->method == HTTP_METHOD_HEAD || + if (req != NULL && req->method == HTTP_METHOD_HEAD || (len == 0 && !(s->flags & SPDY_NO_CLOSE))) { spdy_frame_send(c, SPDY_DATA_FRAME, FLAG_FIN, 0, s, 0); spdy_stream_close(c, s, SPDY_KEEP_NETBUFS); @@ -1269,7 +1269,7 @@ http_response_normal(struct http_request *req, struct connection *c, } } - if (status != 204 && status >= 200 && + if (req != NULL && status != 204 && status >= 200 && !(req->flags & HTTP_REQUEST_NO_CONTENT_LENGTH)) kore_buf_appendf(header_buf, "content-length: %d\r\n", len);