changeset 7348:f6e7831a17d4

Uwsgi: added a check on maximum uwsgi request size. Requested by Chris Caputo.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 03 Sep 2018 19:17:06 +0300
parents b9b3518fa93b
children f6047a579ca1
files src/http/modules/ngx_http_uwsgi_module.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/modules/ngx_http_uwsgi_module.c	Mon Sep 03 19:17:01 2018 +0300
+++ b/src/http/modules/ngx_http_uwsgi_module.c	Mon Sep 03 19:17:06 2018 +0300
@@ -960,6 +960,12 @@
     }
 #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;