mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-28 16:29:56 +00:00
Prevent data_size to be set independently from data
There was not check for data_size field so one could set data to a small set of data and data_size much bigger than size of data leading to buffer overflow. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
parent
2b6695f122
commit
b3be589ab3
@ -1388,6 +1388,7 @@ static int red_get_cursor(RedMemSlotInfo *slots, int group_id,
|
||||
size = red_get_data_chunks_ptr(slots, group_id,
|
||||
get_memslot_id(slots, addr),
|
||||
&chunks, &qxl->chunk);
|
||||
red->data_size = MIN(red->data_size, size);
|
||||
data = red_linearize_chunk(&chunks, size, &free_data);
|
||||
red_put_data_chunks(&chunks);
|
||||
if (free_data) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user