mirror of
https://github.com/nginx/nginx.git
synced 2025-01-19 01:42:58 +08:00
fix copy destination name length, introduced in r3025
This commit is contained in:
parent
0f00b0a801
commit
9db33c9234
@ -605,12 +605,12 @@ ngx_ext_rename_file(ngx_str_t *src, ngx_str_t *to, ngx_ext_rename_file_t *ext)
|
||||
cf.time = ext->time;
|
||||
cf.log = ext->log;
|
||||
|
||||
name = ngx_alloc(to->len + 1 + 10, ext->log);
|
||||
name = ngx_alloc(to->len + 1 + 10 + 1, ext->log);
|
||||
if (name == NULL) {
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
(void) ngx_sprintf(name, "%*s.%010uD%Z", to->len - 1, to->data,
|
||||
(void) ngx_sprintf(name, "%*s.%010uD%Z", to->len, to->data,
|
||||
(uint32_t) ngx_next_temp_number(0));
|
||||
|
||||
if (ngx_copy_file(src->data, name, &cf) == NGX_OK) {
|
||||
|
@ -214,6 +214,8 @@ ngx_http_dav_put_handler(ngx_http_request_t *r)
|
||||
|
||||
ngx_http_map_uri_to_path(r, &path, &root, 0);
|
||||
|
||||
path.len--;
|
||||
|
||||
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
||||
"http put filename: \"%s\"", path.data);
|
||||
|
||||
|
@ -2661,6 +2661,8 @@ ngx_http_upstream_store(ngx_http_request_t *r, ngx_http_upstream_t *u)
|
||||
}
|
||||
}
|
||||
|
||||
path.len--;
|
||||
|
||||
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
||||
"upstream stores \"%s\" to \"%s\"",
|
||||
tf->file.name.data, path.data);
|
||||
|
Loading…
Reference in New Issue
Block a user