aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/perl
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2016-11-01 20:39:21 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2016-11-01 20:39:21 +0300
commit0438b6049855c4f20e4c13c719badacd19308a5c (patch)
tree07fe4345f3658a01d444efe0f4a52047cbd99636 /src/http/modules/perl
parent5a273f2e9042b74467ba217800b9c7b2fe3b4a31 (diff)
downloadnginx-0438b6049855c4f20e4c13c719badacd19308a5c.tar.gz
nginx-0438b6049855c4f20e4c13c719badacd19308a5c.zip
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 (limited to 'src/http/modules/perl')
-rw-r--r--src/http/modules/perl/ngx_http_perl_module.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/http/modules/perl/ngx_http_perl_module.c b/src/http/modules/perl/ngx_http_perl_module.c
index 6a8894cc3..f9a9a84c0 100644
--- 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, ngx_http_ssi_ctx_t *ssi_ctx,
args = &params[NGX_HTTP_PERL_SSI_ARG];
- if (args) {
+ if (args[0]) {
for (i = 0; args[i]; i++) { /* void */ }