From: Fiona Ebner <f.ebner@proxmox.com>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>
Cc: qemu-devel@nongnu.org, kraxel@redhat.com, m.frank@proxmox.com,
berrange@redhat.com, mcascell@redhat.com, qemu-stable@nongnu.org
Subject: Re: [PATCH] ui/clipboard: avoid crash upon request when clipboard peer is not initialized
Date: Mon, 15 Jan 2024 11:44:58 +0100 [thread overview]
Message-ID: <2150aa28-3eba-4e95-a301-d87377ba40a4@proxmox.com> (raw)
In-Reply-To: <CAJ+F1C+JXE9hSQ_oDNZvhpYDqPeeKayopB3x2L2YyJTxM8t+Yg@mail.gmail.com>
Am 14.01.24 um 14:51 schrieb Marc-André Lureau:
>>
>> diff --git a/ui/clipboard.c b/ui/clipboard.c
>> index 3d14bffaf8..c13b54d2e9 100644
>> --- a/ui/clipboard.c
>> +++ b/ui/clipboard.c
>> @@ -129,7 +129,8 @@ void qemu_clipboard_request(QemuClipboardInfo *info,
>> if (info->types[type].data ||
>> info->types[type].requested ||
>> !info->types[type].available ||
>> - !info->owner)
>> + !info->owner ||
>> + !info->owner->request)
>> return;
>
> While that fixes the crash, I think we should handle the situation
> earlier. A clipboard peer shouldn't be allowed to hold the clipboard
> if it doesn't have the data available or a "request" callback set.
>
Where should initialization of the cbpeer happen so that we are
guaranteed to do it also for clients that do not set the
VNC_FEATURE_CLIPBOARD_EXT feature? Can the vnc_clipboard_request
function be re-used for clients without that feature or will it be
necessary to add some kind of "dummy" request callback for those clients?
> Iow, we should have an assert(info->owner->request != NULL) here instead.
>
Your choice of course, but it would be a crash again should the issue
ever re-appear. Would error message (so the issue gets noticed) + return
be an option too?
Best Regards,
Fiona
next prev parent reply other threads:[~2024-01-15 10:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-12 13:55 [PATCH] ui/clipboard: avoid crash upon request when clipboard peer is not initialized Fiona Ebner
2024-01-12 14:11 ` Fiona Ebner
2024-01-14 13:51 ` Marc-André Lureau
2024-01-15 10:44 ` Fiona Ebner [this message]
2024-01-15 11:15 ` Marc-André Lureau
2024-01-15 11:26 ` Fiona Ebner
2024-01-15 11:33 ` Marc-André Lureau
2024-01-15 11:48 ` Fiona Ebner
2024-01-15 12:00 ` Marc-André Lureau
2024-01-16 12:11 ` Fiona Ebner
2024-01-17 10:59 ` Fiona Ebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2150aa28-3eba-4e95-a301-d87377ba40a4@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=berrange@redhat.com \
--cc=kraxel@redhat.com \
--cc=m.frank@proxmox.com \
--cc=marcandre.lureau@gmail.com \
--cc=mcascell@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).