diff --git a/client/X11/xf_cliprdr.c b/client/X11/xf_cliprdr.c index 8662977c7..60c7b856d 100644 --- a/client/X11/xf_cliprdr.c +++ b/client/X11/xf_cliprdr.c @@ -1438,7 +1438,6 @@ static UINT xf_cliprdr_server_format_data_response(CliprdrClientContext* return CHANNEL_RC_OK; } - DstSize = 0; pDstData = (BYTE*) ClipboardGetData(clipboard->system, dstFormatId, &DstSize); if (!pDstData) @@ -1446,7 +1445,6 @@ static UINT xf_cliprdr_server_format_data_response(CliprdrClientContext* WLog_WARN(TAG, "failed to get clipboard data in format %s [source format %s]", ClipboardGetFormatName(clipboard->system, dstFormatId), ClipboardGetFormatName(clipboard->system, srcFormatId)); - return CHANNEL_RC_OK; } if (nullTerminated) diff --git a/winpr/libwinpr/clipboard/clipboard.c b/winpr/libwinpr/clipboard/clipboard.c index 044ef70b2..a851a1ca1 100644 --- a/winpr/libwinpr/clipboard/clipboard.c +++ b/winpr/libwinpr/clipboard/clipboard.c @@ -468,7 +468,8 @@ void* ClipboardGetData(wClipboard* clipboard, UINT32 formatId, UINT32* pSize) DstSize = SrcSize; pDstData = synthesizer->pfnSynthesize(clipboard, format->formatId, pSrcData, &DstSize); - *pSize = DstSize; + if (pDstData) + *pSize = DstSize; } return pDstData;