mirror of
https://github.com/nginx/nginx.git
synced 2025-01-08 07:03:01 -06:00
Resolver: added missing sanity checking when creating name queries.
Found by Veracode.
This commit is contained in:
parent
8e6728ef13
commit
e34ff16f67
@ -1840,7 +1840,7 @@ ngx_resolver_create_name_query(ngx_resolver_node_t *rn, ngx_resolver_ctx_t *ctx)
|
||||
len++;
|
||||
|
||||
} else {
|
||||
if (len == 0) {
|
||||
if (len == 0 || len > 255) {
|
||||
return NGX_DECLINED;
|
||||
}
|
||||
|
||||
@ -1851,6 +1851,10 @@ ngx_resolver_create_name_query(ngx_resolver_node_t *rn, ngx_resolver_ctx_t *ctx)
|
||||
p--;
|
||||
}
|
||||
|
||||
if (len == 0 || len > 255) {
|
||||
return NGX_DECLINED;
|
||||
}
|
||||
|
||||
*p = (u_char) len;
|
||||
|
||||
return NGX_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user