Added proper return value checks for clipboard data.
This commit is contained in:
parent
8cba201999
commit
a1c3c1ad64
@ -1422,6 +1422,14 @@ static UINT xf_cliprdr_server_format_data_response(CliprdrClientContext*
|
|||||||
DstSize = 0;
|
DstSize = 0;
|
||||||
pDstData = (BYTE*) ClipboardGetData(clipboard->system, dstFormatId, &DstSize);
|
pDstData = (BYTE*) ClipboardGetData(clipboard->system, dstFormatId, &DstSize);
|
||||||
|
|
||||||
|
if (!pDstData)
|
||||||
|
{
|
||||||
|
WLog_ERR(TAG, "failed to get clipboard data in format %s [source format %s]",
|
||||||
|
ClipboardGetFormatName(clipboard, dstFormatId),
|
||||||
|
ClipboardGetFormatName(clipboard, srcFormatId));
|
||||||
|
return ERROR_INTERNAL_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
if (nullTerminated)
|
if (nullTerminated)
|
||||||
{
|
{
|
||||||
while (DstSize > 0 && pDstData[DstSize - 1] == '\0')
|
while (DstSize > 0 && pDstData[DstSize - 1] == '\0')
|
||||||
|
@ -436,6 +436,7 @@ void* ClipboardGetData(wClipboard* clipboard, UINT32 formatId, UINT32* pSize)
|
|||||||
if (!pSize)
|
if (!pSize)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
*pSize = 0;
|
||||||
format = ClipboardFindFormat(clipboard, clipboard->formatId, NULL);
|
format = ClipboardFindFormat(clipboard, clipboard->formatId, NULL);
|
||||||
|
|
||||||
if (!format)
|
if (!format)
|
||||||
|
Loading…
Reference in New Issue
Block a user