diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2003-11-18 16:49:00 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2003-11-18 16:49:00 +0000 |
| commit | 222a2adf40eb25ff613c251f15032f1e39d7f609 (patch) | |
| tree | 703e825cbfacdac4e1fdc73889371755bf5f68bb /src/http/ngx_http_cache.c | |
| parent | 0b2b4ccd2c8a31caea0ef760b55a63c2fc169838 (diff) | |
| download | nginx-222a2adf40eb25ff613c251f15032f1e39d7f609.tar.gz nginx-222a2adf40eb25ff613c251f15032f1e39d7f609.tar.bz2 | |
nginx-0.0.1-2003-11-18-19:49:00 import
Diffstat (limited to '')
| -rw-r--r-- | src/http/ngx_http_cache.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/http/ngx_http_cache.c b/src/http/ngx_http_cache.c index b11558c90..b3245a098 100644 --- a/src/http/ngx_http_cache.c +++ b/src/http/ngx_http_cache.c @@ -107,6 +107,13 @@ int ngx_http_cache_open_file(ngx_http_request_t *r, ngx_http_cache_ctx_t *ctx, ctx->date = h->date; ctx->length = h->length; + if (h->key_len > (size_t) (ctx->buf->last - ctx->buf->pos)) { + ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, + "cache file \"%s\" is probably invalid", + ctx->file.name.data); + return NGX_DECLINED; + } + if (h->key_len != ctx->key.len || ngx_strncmp(h->key, ctx->key.data, h->key_len) != 0) { |
