]> git.kaiwu.me - nginx.git/commitdiff
Uwsgi: added a check on maximum uwsgi request size.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 3 Sep 2018 16:17:06 +0000 (19:17 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 3 Sep 2018 16:17:06 +0000 (19:17 +0300)
Requested by Chris Caputo.

src/http/modules/ngx_http_uwsgi_module.c

index 8411cfd8d29b617accb5e9ee0b7227397906b775..d0adbdbf21d29065a78b1175ea442b80e0ec042c 100644 (file)
@@ -960,6 +960,12 @@ ngx_http_uwsgi_create_request(ngx_http_request_t *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;