Welcome! Log In Create A New Profile

Advanced

[nginx] Core: improved ngx_conf_parse() error handling.

Maxim Dounin
April 30, 2014 11:20AM
details: http://hg.nginx.org/nginx/rev/56ad171c3dd1
branches:
changeset: 5681:56ad171c3dd1
user: Maxim Dounin <mdounin@mdounin.ru>
date: Wed Apr 30 19:16:49 2014 +0400
description:
Core: improved ngx_conf_parse() error handling.

Previous code failed to properly restore cf->conf_file in case of
ngx_close_file() errors, potentially resulting in double free of
cf->conf_file->buffer->start.

Found by Coverity (CID 1087507).

diffstat:

src/core/ngx_conf_file.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c
--- a/src/core/ngx_conf_file.c
+++ b/src/core/ngx_conf_file.c
@@ -266,7 +266,7 @@ done:
ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno,
ngx_close_file_n " %s failed",
filename->data);
- return NGX_CONF_ERROR;
+ rc = NGX_ERROR;
}

cf->conf_file = prev;

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Core: improved ngx_conf_parse() error handling.

Maxim Dounin 998 April 30, 2014 11:20AM



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

Online Users

Guests: 263
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