Skip to content

Commit

Permalink
Fixed missing input checks for file contents request
Browse files Browse the repository at this point in the history
reported by Valentino Ricotta (Thalium)
  • Loading branch information
akallabeth committed Jul 22, 2021
1 parent fb3f857 commit 0d79670
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/Windows/wf_cliprdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2363,6 +2363,8 @@ wf_cliprdr_server_file_contents_request(CliprdrClientContext* context,
{
if (fileContentsRequest->dwFlags == FILECONTENTS_SIZE)
{
if (clipboard->nFiles <= fileContentsRequest->listIndex)
goto error;
*((UINT32*)&pData[0]) =
clipboard->fileDescriptor[fileContentsRequest->listIndex]->nFileSizeLow;
*((UINT32*)&pData[4]) =
Expand All @@ -2372,6 +2374,8 @@ wf_cliprdr_server_file_contents_request(CliprdrClientContext* context,
else if (fileContentsRequest->dwFlags == FILECONTENTS_RANGE)
{
BOOL bRet;
if (clipboard->nFiles <= fileContentsRequest->listIndex)
goto error;
bRet = wf_cliprdr_get_file_contents(
clipboard->file_names[fileContentsRequest->listIndex], pData,
fileContentsRequest->nPositionLow, fileContentsRequest->nPositionHigh, cbRequested,
Expand Down

0 comments on commit 0d79670

Please sign in to comment.