[PATCH] proxy-protocol dst variables and proxy-proxy-protocol

Bjørnar Ness bjornar.ness at gmail.com
Mon Sep 19 19:48:28 UTC 2016


Came to my attention that i can be used uninitialized ((thanks, Johnny), so:

diff --git a/src/core/ngx_proxy_protocol.c b/src/core/ngx_proxy_protocol.c
index 04dae8b..21c710a 100644
--- a/src/core/ngx_proxy_protocol.c
+++ b/src/core/ngx_proxy_protocol.c
@@ -13,7 +13,7 @@ u_char *
  ngx_proxy_protocol_read(ngx_connection_t *c, u_char *buf, u_char *last)
  {
      size_t     len;
-    ngx_uint_t i, n;
+    ngx_uint_t i=0, n;
      u_char     ch, *p, *pp;
      ngx_str_t  addr[2], port[2];



More information about the nginx-devel mailing list