Welcome! Log In Create A New Profile

Advanced

[nginx] Perl: fixed optimization in SSI command handler.

Maxim Dounin
November 01, 2016 01:42PM
details: http://hg.nginx.org/nginx/rev/cb4a4e9bba8e
branches:
changeset: 6791:cb4a4e9bba8e
user: Maxim Dounin <mdounin@mdounin.ru>
date: Tue Nov 01 20:39:21 2016 +0300
description:
Perl: fixed optimization in SSI command handler.

As the pointer to the first argument was tested instead of the argument
itself, array of arguments was always created, even if there were no
arguments. Fix is to test args[0] instead of args.

Found by Coverity (CID 1356862).

diffstat:

src/http/modules/perl/ngx_http_perl_module.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff --git a/src/http/modules/perl/ngx_http_perl_module.c b/src/http/modules/perl/ngx_http_perl_module.c
--- a/src/http/modules/perl/ngx_http_perl_module.c
+++ b/src/http/modules/perl/ngx_http_perl_module.c
@@ -410,7 +410,7 @@ ngx_http_perl_ssi(ngx_http_request_t *r,

args = &params[NGX_HTTP_PERL_SSI_ARG];

- if (args) {
+ if (args[0]) {

for (i = 0; args[i]; i++) { /* void */ }


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

[nginx] Perl: fixed optimization in SSI command handler.

Maxim Dounin 520 November 01, 2016 01:42PM



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

Online Users

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