Peter Maydell e12acaf75d ui/vnc-enc-hextile: Use static rather than dynamic length stack array
In the send_hextile_tile_* function we create a variable length array
data[].  In fact we know that the client_pf.bytes_per_pixel is at
most 4 (enforced by set_pixel_format()), so we can make the array a
compile-time fixed length of 1536 bytes.

The codebase has very few VLAs, and if we can get rid of them all we
can make the compiler error on new additions.  This is a defensive
measure against security bugs where an on-stack dynamic allocation
isn't correctly size-checked (e.g.  CVE-2021-3527).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
[ Marc-André - rename BPP to MAX_BYTES_PER_PIXEL ]
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20230818151057.1541189-3-peter.maydell@linaro.org>
2023-09-04 14:57:44 +04:00
..
2023-06-27 17:08:56 +02:00
2023-06-27 17:08:56 +02:00
2023-06-27 17:08:56 +02:00
2022-05-03 15:52:37 +04:00
2022-03-14 15:16:16 +04:00
2023-06-27 17:08:56 +02:00
2022-11-08 10:23:06 +01:00
2022-11-08 10:23:06 +01:00
2022-11-08 10:23:06 +01:00
2023-06-05 20:48:34 +02:00
2023-03-13 22:57:39 +04:00