qemu/hw/ide
Peter Maydell f63085c85d hw/ide/atapi: Be explicit that assigning to s->lcyl truncates
In ide_atapi_cmd_reply_end() we calculate a 16-bit size, and then
assign its two halves to s->lcyl and s->hcyl like this:

           s->lcyl = size;
           s->hcyl = size >> 8;

Coverity warns that the first line here can overflow the
8-bit s->lcyl variable. This is true, and in this case we're
deliberately only after the low 8 bits of the value. The
code is clearer to both humans and Coverity if we're explicit
that we only wanted the low 8 bits, though.

Resolves: Coverity CID 1547621
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20240731143617.3391947-5-peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2024-08-06 10:22:52 +02:00
..
ahci-allwinner.c hw/ide/ahci: Move SysBus definitions to 'ahci-sysbus.h' 2024-02-15 16:58:46 +01:00
ahci-internal.h hw/ide/ahci: Rename ahci_internal.h to ahci-internal.h 2024-03-11 22:09:42 +01:00
ahci.c hw/ide/ahci: Rename ahci_internal.h to ahci-internal.h 2024-03-11 22:09:42 +01:00
atapi.c hw/ide/atapi: Be explicit that assigning to s->lcyl truncates 2024-08-06 10:22:52 +02:00
cf.c hw/ide: Add the possibility to disable the CompactFlash device in the build 2024-02-22 12:47:40 +01:00
cmd646.c hw/ide: Include 'ide-internal.h' from current path 2024-02-27 09:37:30 +01:00
core.c hw/ide/core.c (cmd_read_native_max): Avoid limited device parameters 2024-04-30 06:21:47 +02:00
ich.c hw/ide/ahci: Rename ahci_internal.h to ahci-internal.h 2024-03-11 22:09:42 +01:00
ide-bus.c hw/ide: Include 'ide-internal.h' from current path 2024-02-27 09:37:30 +01:00
ide-dev.c ide, vl: turn -win2k-hack into a property on IDE devices 2024-02-28 00:23:39 +01:00
ide-internal.h ide: collapse parameters to ide_init_drive 2024-02-28 00:23:39 +01:00
ioport.c hw/ide: Include 'ide-internal.h' from current path 2024-02-27 09:37:30 +01:00
isa.c hw/ide: Include 'ide-internal.h' from current path 2024-02-27 09:37:30 +01:00
Kconfig hw/ide: Split qdev.c into ide-bus.c and ide-dev.c 2024-02-22 12:47:40 +01:00
macio.c hw/ide/macio: switch from using qemu_allocate_irq() to qdev input GPIOs 2024-07-02 06:58:48 +02:00
meson.build hw/ide: Split qdev.c into ide-bus.c and ide-dev.c 2024-02-22 12:47:40 +01:00
microdrive.c hw/ide: Include 'ide-internal.h' from current path 2024-02-27 09:37:30 +01:00
mmio.c hw/ide: Include 'ide-internal.h' from current path 2024-02-27 09:37:30 +01:00
pci.c hw/ide: Include 'ide-internal.h' from current path 2024-02-27 09:37:30 +01:00
piix.c hw/ide: Include 'ide-internal.h' from current path 2024-02-27 09:37:30 +01:00
sii3112.c hw/ide: Include 'ide-internal.h' from current path 2024-02-27 09:37:30 +01:00
trace-events hw/ide: Rename ide_exec_cmd() -> ide_bus_exec_cmd() 2023-02-27 22:29:02 +01:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
via.c hw/ide: Include 'ide-internal.h' from current path 2024-02-27 09:37:30 +01:00