[nginx] Uwsgi: added a check on maximum uwsgi request size.

Maxim Dounin mdounin at mdounin.ru
Mon Sep 3 16:32:01 UTC 2018


details:   http://hg.nginx.org/nginx/rev/f6e7831a17d4
branches:  
changeset: 7348:f6e7831a17d4
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Mon Sep 03 19:17:06 2018 +0300
description:
Uwsgi: added a check on maximum uwsgi request size.

Requested by Chris Caputo.

diffstat:

 src/http/modules/ngx_http_uwsgi_module.c |  6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diffs (16 lines):

diff --git a/src/http/modules/ngx_http_uwsgi_module.c b/src/http/modules/ngx_http_uwsgi_module.c
--- a/src/http/modules/ngx_http_uwsgi_module.c
+++ b/src/http/modules/ngx_http_uwsgi_module.c
@@ -960,6 +960,12 @@ ngx_http_uwsgi_create_request(ngx_http_r
     }
 #endif
 
+    if (len > 65535) {
+        ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
+                      "uwsgi request is too big: %uz", len);
+        return NGX_ERROR;
+    }
+
     b = ngx_create_temp_buf(r->pool, len + 4);
     if (b == NULL) {
         return NGX_ERROR;


More information about the nginx-devel mailing list