Welcome! Log In Create A New Profile

Advanced

[nginx] Proxy: error checking for array init, missed in 7716:d6a5e14aa3e4.

Maxim Dounin
September 29, 2020 09:20AM
details: https://hg.nginx.org/nginx/rev/a88384c69d1e
branches:
changeset: 7720:a88384c69d1e
user: Maxim Dounin <mdounin@mdounin.ru>
date: Tue Sep 29 15:54:09 2020 +0300
description:
Proxy: error checking for array init, missed in 7716:d6a5e14aa3e4.

Found by Coverity (CID 1467637).

diffstat:

src/http/modules/ngx_http_proxy_module.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diffs (14 lines):

diff -r c0cacad62cc8 -r a88384c69d1e src/http/modules/ngx_http_proxy_module.c
--- a/src/http/modules/ngx_http_proxy_module.c Tue Sep 29 15:52:18 2020 +0300
+++ b/src/http/modules/ngx_http_proxy_module.c Tue Sep 29 15:54:09 2020 +0300
@@ -2679,7 +2679,9 @@ ngx_http_proxy_rewrite_cookie(ngx_http_r
ngx_keyval_t *attr;
ngx_http_proxy_loc_conf_t *plcf;

- ngx_array_init(&attrs, r->pool, 2, sizeof(ngx_keyval_t));
+ if (ngx_array_init(&attrs, r->pool, 2, sizeof(ngx_keyval_t)) != NGX_OK) {
+ return NGX_ERROR;
+ }

if (ngx_http_proxy_parse_cookie(&h->value, &attrs) != NGX_OK) {
return NGX_ERROR;
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Proxy: error checking for array init, missed in 7716:d6a5e14aa3e4.

Maxim Dounin 290 September 29, 2020 09:20AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 278
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready