[Spice-devel] [PATCH 0.8 3/9] server: break read_from_vdi_port loop if the guest gets disconnected
Alon Levy
alevy at redhat.com
Fri Apr 1 08:29:39 PDT 2011
On Fri, Apr 01, 2011 at 05:13:03PM +0200, Hans de Goede wrote:
> 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.
ACK
> ---
> server/reds.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/server/reds.c b/server/reds.c
> index b286809..088683b 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -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);
> --
> 1.7.4.2
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
More information about the Spice-devel
mailing list