server: break read_from_vdi_port loop if the guest gets disconnected

read_from_vdi_port calls dispatch_vdi_port data, which will disconnect
the guest agent if it sends invalid data. It would then try to read more
data from the disconnected guest agent resulting in a NULL ptr dereference,
this patch fixes this.
This commit is contained in:
Hans de Goede 2011-04-01 10:34:24 +02:00
parent 7cc85f33be
commit a19f51265c

View File

@ -1292,7 +1292,7 @@ static int read_from_vdi_port(void)
}
sif = SPICE_CONTAINEROF(vdagent->base.sif, SpiceCharDeviceInterface, base);
while (!quit_loop) {
while (!quit_loop && vdagent) {
switch (state->read_state) {
case VDI_PORT_READ_STATE_READ_HADER:
n = sif->read(vdagent, state->recive_pos, state->recive_len);