From: Markus Armbruster <armbru@redhat.com>
To: Bernhard Beschow <shentey@gmail.com>
Cc: qemu-devel@nongnu.org, sstabellini@kernel.org,
anthony@xenproject.org, paul@xen.org, edgar.iglesias@gmail.com,
xen-devel@lists.xenproject.org, qemu-trivial@nongnu.org
Subject: Re: [PATCH] hw/display/xenfb: Replace unreachable code by abort()
Date: Tue, 14 Oct 2025 09:42:32 +0200 [thread overview]
Message-ID: <87tt02ylnb.fsf@pond.sub.org> (raw)
In-Reply-To: <20C81C5B-912C-49B3-B50A-867C06C134B1@gmail.com> (Bernhard Beschow's message of "Mon, 13 Oct 2025 19:17:28 +0000")
Bernhard Beschow <shentey@gmail.com> writes:
> Am 13. Oktober 2025 11:10:45 UTC schrieb Markus Armbruster <armbru@redhat.com>:
>>Ping?
>>
>>Markus Armbruster <armbru@redhat.com> writes:
>>
>>> xenfb_mouse_event() has a switch statement whose controlling
>>> expression move->axis is an enum InputAxis. The enum values are
>>> INPUT_AXIS_X and INPUT_AXIS_Y, encoded as 0 and 1. The switch has a
>>> case for both axes. In addition, it has an unreachable default label.
>>> This convinces Coverity that move->axis can be greater than 1. It
>>> duly reports a buffer overrun when it is used to subscript an array
>>> with two elements.
>>>
>>> Replace the unreachable code by abort().
>>>
>>> Resolves: Coverity CID 1613906
>>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>>> ---
>>> hw/display/xenfb.c | 3 +--
>>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>>
>>> diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
>>> index 22822fecea..5e6c691779 100644
>>> --- a/hw/display/xenfb.c
>>> +++ b/hw/display/xenfb.c
>>> @@ -283,8 +283,7 @@ static void xenfb_mouse_event(DeviceState *dev, QemuConsole *src,
>>> scale = surface_height(surface) - 1;
>>> break;
>>> default:
>>> - scale = 0x8000;
>>> - break;
>>> + abort();
>
> Don't we prefer g_assert_not_reached() these days, for more expressiveness?
See https://lore.kernel.org/qemu-devel/87v7nbdwfx.fsf@pond.sub.org/
[...]
next prev parent reply other threads:[~2025-10-14 7:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-29 11:12 [PATCH] hw/display/xenfb: Replace unreachable code by abort() Markus Armbruster
2025-07-29 11:26 ` Philippe Mathieu-Daudé
2025-07-29 12:16 ` Markus Armbruster
2025-07-29 12:59 ` Philippe Mathieu-Daudé
2025-07-29 13:16 ` Daniel P. Berrangé
2025-10-13 11:10 ` Markus Armbruster
2025-10-13 14:14 ` Philippe Mathieu-Daudé
2025-10-13 19:17 ` Bernhard Beschow
2025-10-14 7:42 ` Markus Armbruster [this message]
2025-10-14 8:36 ` Peter Maydell
2025-10-14 12:59 ` Peter Maydell
2025-10-14 15:19 ` Philippe Mathieu-Daudé
2025-10-15 5:50 ` Markus Armbruster
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=87tt02ylnb.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=anthony@xenproject.org \
--cc=edgar.iglesias@gmail.com \
--cc=paul@xen.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=shentey@gmail.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.