]> git.kaiwu.me - nginx.git/commitdiff
Upstream: fixed request chain traversal (ticket #1618).
authorVladimir Homutov <vl@nginx.com>
Fri, 24 Aug 2018 09:19:37 +0000 (12:19 +0300)
committerVladimir Homutov <vl@nginx.com>
Fri, 24 Aug 2018 09:19:37 +0000 (12:19 +0300)
The problem does not manifest itself currently, because in case of
non-buffered reading, chain link created by u->create_request method
consists of a single element.

Found by PVS-Studio.

src/http/ngx_http_upstream.c

index 605ae34864abd816b9a70499000ffcf9136d8b84..6901941756c422790fbfd25d7c025e03296ca164 100644 (file)
@@ -2135,7 +2135,7 @@ ngx_http_upstream_send_request_body(ngx_http_request_t *r,
         out = u->request_bufs;
 
         if (r->request_body->bufs) {
-            for (cl = out; cl->next; cl = out->next) { /* void */ }
+            for (cl = out; cl->next; cl = cl->next) { /* void */ }
             cl->next = r->request_body->bufs;
             r->request_body->bufs = NULL;
         }