| 1 | commit 3beb550dc3d5c23f2c6e8621025085f1703ea7a6
|
|---|
| 2 | Author: John Leach <john@johnleach.co.uk>
|
|---|
| 3 | Date: Fri Feb 1 18:55:17 2013 +0000
|
|---|
| 4 |
|
|---|
| 5 | Fix false positive memset zero len warning (#275)
|
|---|
| 6 |
|
|---|
| 7 | diff --git a/src/http/modules/ngx_http_autoindex_module.c b/src/http/modules/ngx_http_autoindex_module.c
|
|---|
| 8 | index 450a48e..bdf7c11 100644
|
|---|
| 9 | --- a/src/http/modules/ngx_http_autoindex_module.c
|
|---|
| 10 | +++ b/src/http/modules/ngx_http_autoindex_module.c
|
|---|
| 11 | @@ -489,7 +489,8 @@ ngx_http_autoindex_handler(ngx_http_request_t *r)
|
|---|
| 12 | }
|
|---|
| 13 |
|
|---|
| 14 | b->last = ngx_cpymem(b->last, "</a>", sizeof("</a>") - 1);
|
|---|
| 15 | - ngx_memset(b->last, ' ', NGX_HTTP_AUTOINDEX_NAME_LEN - len);
|
|---|
| 16 | + if (len < NGX_HTTP_AUTOINDEX_NAME_LEN)
|
|---|
| 17 | + ngx_memset(b->last, ' ', NGX_HTTP_AUTOINDEX_NAME_LEN - len);
|
|---|
| 18 | b->last += NGX_HTTP_AUTOINDEX_NAME_LEN - len;
|
|---|
| 19 | }
|
|---|
| 20 |
|
|---|