[Spice-devel] [linux-vdagent PATCH 02/10] vdagent-virtio-port: Fix use after free

Hans de Goede hdegoede at redhat.com
Wed Mar 6 07:22:38 PST 2013


Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 src/vdagent-virtio-port.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/vdagent-virtio-port.c b/src/vdagent-virtio-port.c
index de4b748..7e9a3e6 100644
--- a/src/vdagent-virtio-port.c
+++ b/src/vdagent-virtio-port.c
@@ -392,6 +392,8 @@ static void vdagent_virtio_port_do_read(struct vdagent_virtio_port **vportp)
         vport->chunk_data_pos += n;
         if (vport->chunk_data_pos == vport->chunk_header.size) {
             vdagent_virtio_port_do_chunk(vportp);
+            if (!*vportp)
+                return;
             vport->chunk_header_read = 0;
             vport->chunk_data_pos = 0;
         }
-- 
1.8.1.4



More information about the Spice-devel mailing list