mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-07 12:36:46 +00:00
inputs-channel: Check message size handling migration data
Prevent possible buffer reading overflow. Note that message pointer must be valid and data are checked value by value so even on overflow you just get an error. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
parent
dd51cef748
commit
617479413e
@ -505,6 +505,11 @@ static bool inputs_channel_handle_migrate_data(RedChannelClient *rcc,
|
||||
SpiceMigrateDataHeader *header;
|
||||
SpiceMigrateDataInputs *mig_data;
|
||||
|
||||
if (size < sizeof(SpiceMigrateDataHeader) + sizeof(SpiceMigrateDataInputs)) {
|
||||
spice_warning("bad message size %u", size);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
header = (SpiceMigrateDataHeader *)message;
|
||||
mig_data = (SpiceMigrateDataInputs *)(header + 1);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user