[nginx] Upstream: fixed request chain traversal (ticket #1618).

Vladimir Homutov vl at nginx.com
Fri Aug 24 15:04:09 UTC 2018


details:   http://hg.nginx.org/nginx/rev/15ea84e65d07
branches:  
changeset: 7341:15ea84e65d07
user:      Vladimir Homutov <vl at nginx.com>
date:      Fri Aug 24 12:19:37 2018 +0300
description:
Upstream: fixed request chain traversal (ticket #1618).

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.

diffstat:

 src/http/ngx_http_upstream.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 70c6b08973a0 -r 15ea84e65d07 src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c	Fri Aug 10 21:54:46 2018 +0300
+++ b/src/http/ngx_http_upstream.c	Fri Aug 24 12:19:37 2018 +0300
@@ -2135,7 +2135,7 @@ ngx_http_upstream_send_request_body(ngx_
         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;
         }


More information about the nginx-devel mailing list