From 8973613c4b4b3f062ce689797c9e652d8ff282c4 Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Wed, 3 Dec 2008 14:27:06 -0600 Subject: [PATCH] Fix unitialized offset in virtio-net receive_header If vnet support is not available on the tap device, offset is uninitialized and badness ensues. Signed-off-by: Anthony Liguori Signed-off-by: Avi Kivity --- hw/virtio-net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 6493ff6379..1283735262 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -163,7 +163,7 @@ static int receive_header(VirtIONet *n, struct iovec *iov, int iovcnt, const void *buf, int size, int hdr_len) { struct virtio_net_hdr *hdr = iov[0].iov_base; - int offset; + int offset = 0; hdr->flags = 0; hdr->gso_type = VIRTIO_NET_HDR_GSO_NONE; -- 2.11.4.GIT