From 1f1ce81b221a6a194875b69c1debbc375efc357f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Wed, 26 May 2021 14:29:52 -0400 Subject: [PATCH] Gracefully handle edge case where clipboard format name is NULL --- winpr/libwinpr/clipboard/clipboard.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/winpr/libwinpr/clipboard/clipboard.c b/winpr/libwinpr/clipboard/clipboard.c index 2e88d75bb..0d236e8da 100644 --- a/winpr/libwinpr/clipboard/clipboard.c +++ b/winpr/libwinpr/clipboard/clipboard.c @@ -89,6 +89,9 @@ static wClipboardFormat* ClipboardFindFormat(wClipboard* clipboard, UINT32 forma { for (index = 0; index < clipboard->numFormats; index++) { + if (!clipboard->formats[index].formatName) + continue; + if (strcmp(name, clipboard->formats[index].formatName) == 0) { format = &clipboard->formats[index];