mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-07-06 07:14:57 +03:00
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -479,12 +479,14 @@ static HRESULT STDMETHODCALLTYPE CliprdrStream_Read(IStream *This, void *pv, ULO
|
|||||||
return STG_E_READFAULT;
|
return STG_E_READFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
// A successful request must have produced a buffer. If it did not, fail the
|
// A successful request may legitimately return 0 bytes (EOF); only treat a NULL
|
||||||
// read instead of reporting stale or uninitialized bytes to the caller.
|
// buffer as an error when a non-zero size was reported.
|
||||||
if (!req_data)
|
if (req_size > 0)
|
||||||
return E_FAIL;
|
{
|
||||||
|
if (!req_data)
|
||||||
CopyMemory(pv, req_data, req_size);
|
return E_FAIL;
|
||||||
|
CopyMemory(pv, req_data, req_size);
|
||||||
|
}
|
||||||
free(req_data);
|
free(req_data);
|
||||||
|
|
||||||
*pcbRead = req_size;
|
*pcbRead = req_size;
|
||||||
|
|||||||
Reference in New Issue
Block a user