mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
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.
This commit is contained in:
parent
5b23fe690f
commit
35fce42269
@ -1093,7 +1093,7 @@ ngx_http_ssl_session_cache(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
||||
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, ngx_command_t *cmd, void *conf)
|
||||
len++;
|
||||
}
|
||||
|
||||
if (len == 0) {
|
||||
if (len == 0 || j == value[1].len) {
|
||||
goto invalid;
|
||||
}
|
||||
|
||||
|
@ -682,7 +682,7 @@ ngx_mail_ssl_session_cache(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
||||
len++;
|
||||
}
|
||||
|
||||
if (len == 0) {
|
||||
if (len == 0 || j == value[i].len) {
|
||||
goto invalid;
|
||||
}
|
||||
|
||||
|
@ -1073,7 +1073,7 @@ ngx_stream_ssl_session_cache(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
||||
len++;
|
||||
}
|
||||
|
||||
if (len == 0) {
|
||||
if (len == 0 || j == value[i].len) {
|
||||
goto invalid;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user