mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-14 03:35:52 +00:00
fix crash if agent interface is removed
Removing an interface cause SpiceBaseInstance->st to be set to NULL. This pointer was then deferenced in agent code. As SpiceBaseInstance should not be used after this call make sure we don't keep pointers to it. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
parent
448f037a3c
commit
07b7abeb59
@ -3265,6 +3265,7 @@ static void spice_server_char_device_remove_interface(RedsState *reds, SpiceBase
|
||||
if (strcmp(char_device->subtype, SUBTYPE_VDAGENT) == 0) {
|
||||
if (reds->vdagent) {
|
||||
reds_agent_remove(reds);
|
||||
red_char_device_reset_dev_instance(RED_CHAR_DEVICE(reds->agent_dev), NULL);
|
||||
}
|
||||
}
|
||||
#ifdef USE_SMARTCARD
|
||||
|
||||
@ -67,6 +67,11 @@ int spice_server_add_ssl_client(SpiceServer *s, int socket, int skip_auth);
|
||||
|
||||
int spice_server_add_interface(SpiceServer *s,
|
||||
SpiceBaseInstance *sin);
|
||||
/**
|
||||
* Remove an interface from SpiceServer.
|
||||
* SpiceServer won't be using the interface anymore, so it can
|
||||
* be freed or reused.
|
||||
*/
|
||||
int spice_server_remove_interface(SpiceBaseInstance *sin);
|
||||
|
||||
// Needed for backward API compatibility
|
||||
|
||||
Loading…
Reference in New Issue
Block a user