From e038f1e9cc61e735645a3ac8605b055614327040 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Thu, 7 Feb 2019 17:42:31 +0300 Subject: Version bump. --- src/nxt_main.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nxt_main.h b/src/nxt_main.h index 71ee6599..760384ea 100644 --- a/src/nxt_main.h +++ b/src/nxt_main.h @@ -11,8 +11,8 @@ #include -#define NXT_VERSION "1.7" -#define NXT_VERNUM 10700 +#define NXT_VERSION "1.7.1" +#define NXT_VERNUM 10701 #define NXT_SERVER "Unit/" NXT_VERSION -- cgit From 627b116c4db8d7b0b9cb4e15486bd2847d03ee8a Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Fri, 18 Jan 2019 16:18:36 +0300 Subject: Testing correct value. --- src/nxt_http_error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nxt_http_error.c b/src/nxt_http_error.c index 65f8ba38..99d27903 100644 --- a/src/nxt_http_error.c +++ b/src/nxt_http_error.c @@ -37,7 +37,7 @@ nxt_http_request_error(nxt_task_t *task, nxt_http_request_t *r, r->status = status; r->resp.fields = nxt_list_create(r->mem_pool, 8, sizeof(nxt_http_field_t)); - if (nxt_slow_path(r == NULL)) { + if (nxt_slow_path(r->resp.fields == NULL)) { goto fail; } -- cgit From 83dd67d2164bc3df61e8ede97467c0bbc31e395b Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Thu, 7 Feb 2019 17:40:27 +0300 Subject: Rejecting requests with invalid "Content-Length". --- src/nxt_http_request.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/nxt_http_request.c b/src/nxt_http_request.c index b80998cb..c8adb499 100644 --- a/src/nxt_http_request.c +++ b/src/nxt_http_request.c @@ -79,14 +79,20 @@ nxt_int_t nxt_http_request_content_length(void *ctx, nxt_http_field_t *field, uintptr_t data) { + nxt_off_t n; nxt_http_request_t *r; r = ctx; - r->content_length = field; - r->content_length_n = nxt_off_t_parse(field->value, field->value_length); - return NXT_OK; + n = nxt_off_t_parse(field->value, field->value_length); + + if (nxt_fast_path(n >= 0)) { + r->content_length_n = n; + return NXT_OK; + } + + return NXT_ERROR; } -- cgit