[PATCH] MSAN use-of-uninitialized-value inside ngx_regex_module_init

Maciej maciej.grochowski at pm.me
Thu Apr 9 06:07:50 UTC 2020


Hi Nginx devlist!

This patch fix use-of-uninitialized-value inside ngx_regex_module_init that come after Nginx is run with Clang MSAN

SUMMARY: MemorySanitizer: use-of-uninitialized-value /workspace/nginx/src/core/ngx_regex.c:343:13 in ngx_regex_module_init
==45705==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x13cc4df in ngx_regex_module_init /workspace/nginx/src/core/ngx_regex.c:343:13
    #1 0x126187b in ngx_init_modules /workspace/nginx/src/core/ngx_module.c:72:17
    #2 0x122d30e in ngx_init_cycle /workspace/nginx/src/core/ngx_cycle.c:625:9
    #3 0x10f2189 in main /workspace/nginx/src/core/nginx.c:291:13
    #4 0x109d10a in _start /usr/src/lib/csu/amd64/crt1.c:76:7

Apologizes for lack of HG style patch. Hopefully standard diff will be good enough for such a small change.

diff --git a/src/core/ngx_regex.c b/src/core/ngx_regex.c
index 52169f65..35cf8fd5 100644
--- a/src/core/ngx_regex.c
+++ b/src/core/ngx_regex.c
@@ -293,6 +293,7 @@ ngx_regex_module_init(ngx_cycle_t *cycle)
     ngx_regex_elt_t  *elts;

     opt = 0;
+    errstr = NULL;

#if (NGX_HAVE_PCRE_JIT)
     {
--
2.24.1

Thanks
Maciej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20200409/405c155c/attachment-0001.htm>


More information about the nginx-devel mailing list