changeset 6791:cb4a4e9bba8e

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).
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 01 Nov 2016 20:39:21 +0300
parents 727c6412673a
children 45d553812055
files src/http/modules/perl/ngx_http_perl_module.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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 */ }