fs-event: fix invalid memory access

file_info->FileName is not null terminated.
This commit is contained in:
huxingyi 2013-10-24 16:10:44 +08:00 committed by Bert Belder
parent 47d98b64c4
commit da32344730

View File

@ -339,7 +339,8 @@ void uv_process_fs_event_req(uv_loop_t* loop, uv_req_t* req,
uv_fatal_error(ERROR_OUTOFMEMORY, "malloc");
}
_snwprintf(filenamew, size, L"%s\\%s", handle->dirw,
_snwprintf(filenamew, size, L"%s\\%.*s", handle->dirw,
file_info->FileNameLength / sizeof(WCHAR),
file_info->FileName);
filenamew[size - 1] = L'\0';