diff options
author | Sergey Kandaurov <pluknet@nginx.com> | 2017-03-28 14:21:38 +0300 |
---|---|---|
committer | Sergey Kandaurov <pluknet@nginx.com> | 2017-03-28 14:21:38 +0300 |
commit | 9ad18e43ac2c9956399018cbb998337943988333 (patch) | |
tree | 5fa775ea2ea833bb65b18714d3eafd3539a784b5 /src/http/ngx_http_script.c | |
parent | eb017e75cf1b1d82179935b0e23d0c3451b33a87 (diff) | |
download | nginx-9ad18e43ac2c9956399018cbb998337943988333.tar.gz nginx-9ad18e43ac2c9956399018cbb998337943988333.zip |
Fixed ngx_open_cached_file() error handling.
If of.err is 0, it means that there was a memory allocation error
and no further logging and/or processing is needed. The of.failed
string can be only accessed if of.err is not 0.
Diffstat (limited to 'src/http/ngx_http_script.c')
-rw-r--r-- | src/http/ngx_http_script.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c index cc4d67943..96f3ec696 100644 --- a/src/http/ngx_http_script.c +++ b/src/http/ngx_http_script.c @@ -1513,6 +1513,12 @@ ngx_http_script_file_code(ngx_http_script_engine_t *e) if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) != NGX_OK) { + if (of.err == 0) { + e->ip = ngx_http_script_exit; + e->status = NGX_HTTP_INTERNAL_SERVER_ERROR; + return; + } + if (of.err != NGX_ENOENT && of.err != NGX_ENOTDIR && of.err != NGX_ENAMETOOLONG) |