Mercurial > hg > nginx
diff src/http/modules/ngx_http_ssl_module.c @ 8088:e32b48848add
SSL: improved validation of ssl_session_cache and ssl_ocsp_cache.
Now it properly detects invalid shared zone configuration with omitted size.
Previously it used to read outside of the buffer boundary.
Found with AddressSanitizer.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 17 Oct 2022 16:24:53 +0400 |
parents | 3443c02ca1d1 |
children | d1cf09451ae8 3be953161026 |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_ssl_module.c +++ b/src/http/modules/ngx_http_ssl_module.c @@ -1093,7 +1093,7 @@ ngx_http_ssl_session_cache(ngx_conf_t *c len++; } - if (len == 0) { + if (len == 0 || j == value[i].len) { goto invalid; } @@ -1183,7 +1183,7 @@ ngx_http_ssl_ocsp_cache(ngx_conf_t *cf, len++; } - if (len == 0) { + if (len == 0 || j == value[1].len) { goto invalid; }