[PATCH 4 of 4] inet: use explicit memzero to avoid optimizations

Vadim Fedorenko vadim.fedorenko at cdnnow.ru
Mon Apr 17 23:07:10 UTC 2023


# HG changeset patch
# User Vadim Fedorenko <vadim.fedorenko at cdnnow.ru>
# Date 1681771255 -10800
#      Tue Apr 18 01:40:55 2023 +0300
# Node ID 460c71c36b00fdd510cb511a5714face68280dac
# Parent  5663d8ff4399e7e76369c024db59c40178290213
inet: use explicit memzero to avoid optimizations.

GCC11+ removes memzero call in ngx_inet6_addr(). Use
ngx_explicit_memzero() to avoid optimization.
---
 src/core/ngx_inet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -r 5663d8ff4399 -r 460c71c36b00 src/core/ngx_inet.c
--- a/src/core/ngx_inet.c	Tue Apr 18 01:40:20 2023 +0300
+++ b/src/core/ngx_inet.c	Tue Apr 18 01:40:55 2023 +0300
@@ -163,7 +163,7 @@
             while (s >= zero) {
                 *d-- = *s--;
             }
-            ngx_memzero(zero, n);
+            ngx_explicit_memzero(zero, n);
             return NGX_OK;
         }
 


More information about the nginx-devel mailing list