You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/replay
Peter Maydell 78d66a25c5 replay: Improve assert in replay_char_read_all_load()
In replay_char_read_all_load() we get a buffer and size from the
replay log.  We know the size has to fit an int because of how we
write the log.  However the way we assert this is wrong: we cast the
size_t from replay_get_array() to an int and then check that it is
non-negative.  This misses cases where an over-large size is
truncated into a positive value by the cast.

Replace the assertion with checking that the size is in-range
before doing the cast.

Coverity complained about the possible overflow: CID 1643440.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251124173407.50124-1-peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
1 week ago
..
meson.build meson: Replace softmmu_ss -> system_ss 2 years ago
replay-audio.c audio: move audio.h under include/qemu/ 1 month ago
replay-char.c replay: Improve assert in replay_char_read_all_load() 1 week ago
replay-debugging.c qapi: Move include/qapi/qmp/ to include/qobject/ 10 months ago
replay-events.c cpus: properly kick CPUs out of inner execution loop 3 months ago
replay-input.c include: Rename sysemu/ -> system/ 12 months ago
replay-internal.c replay: add tracing events 2 weeks ago
replay-internal.h replay: introduce a central report point for sync errors 2 years ago
replay-net.c include: Rename sysemu/ -> system/ 12 months ago
replay-random.c include: Rename sysemu/ -> system/ 12 months ago
replay-snapshot.c qapi: Move include/qapi/qmp/ to include/qobject/ 10 months ago
replay-time.c include: Rename sysemu/ -> system/ 12 months ago
replay.c record/replay: fix race condition on test_aarch64_reverse_debug 2 months ago
stubs-system.c audio/replay: fix type punning 1 month ago
trace-events replay: add tracing events 2 weeks ago
trace.h replay: add tracing events 2 weeks ago