mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-09 22:36:29 +00:00
server/reds: fix possible segfault when accessing vdagent from reds_update_mouse_mode after vdagent set to NULL
This commit is contained in:
parent
cdfa261dbb
commit
cd6c57e337
@ -733,6 +733,8 @@ static void reds_agent_remove()
|
||||
SpiceCharDeviceInstance *sin = vdagent;
|
||||
SpiceCharDeviceInterface *sif;
|
||||
|
||||
ASSERT(reds->agent_state.connected)
|
||||
reds->agent_state.connected = 0;
|
||||
vdagent = NULL;
|
||||
reds_update_mouse_mode();
|
||||
|
||||
@ -740,9 +742,7 @@ static void reds_agent_remove()
|
||||
return;
|
||||
}
|
||||
|
||||
ASSERT(reds->agent_state.connected)
|
||||
sif = SPICE_CONTAINEROF(sin->base.sif, SpiceCharDeviceInterface, base);
|
||||
reds->agent_state.connected = 0;
|
||||
if (sif->state) {
|
||||
sif->state(sin, reds->agent_state.connected);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user