mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-30 17:49:02 +00:00
test-display-base: Use unsigned numbers for command ring indexes
As the indexes are used to compute the index inside an array using modulo operation when a signed value overflows, the modulo becames negative, causing a buffer underflow. Unlikely to happens (take lot of time) but is safer that way. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
parent
6db3ee7f83
commit
f73fbdcae5
@ -464,8 +464,8 @@ static void get_init_info(SPICE_GNUC_UNUSED QXLInstance *qin,
|
||||
// which cannot be done from red_worker context (not via dispatcher,
|
||||
// since you get a deadlock, and it isn't designed to be done
|
||||
// any other way, so no point testing that).
|
||||
static int commands_end = 0;
|
||||
static int commands_start = 0;
|
||||
static unsigned int commands_end = 0;
|
||||
static unsigned int commands_start = 0;
|
||||
static struct QXLCommandExt* commands[1024];
|
||||
|
||||
#define COMMANDS_SIZE G_N_ELEMENTS(commands)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user