kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix unitialized offset in virtio-net receive_header
@ 2008-12-03 20:27 Anthony Liguori
  2008-12-04 12:06 ` Mark McLoughlin
  2008-12-05 17:39 ` Avi Kivity
  0 siblings, 2 replies; 4+ messages in thread
From: Anthony Liguori @ 2008-12-03 20:27 UTC (permalink / raw)
  To: kvm; +Cc: Avi Kivity, Mark McLoughlin, Anthony Liguori

If vnet support is not available on the tap device, offset is uninitialized and
badness ensues.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

diff --git a/qemu/hw/virtio-net.c b/qemu/hw/virtio-net.c
index b5d5f9e..4d7e6ad 100644
--- a/qemu/hw/virtio-net.c
+++ b/qemu/hw/virtio-net.c
@@ -219,7 +219,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;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-12-05 17:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-03 20:27 [PATCH] Fix unitialized offset in virtio-net receive_header Anthony Liguori
2008-12-04 12:06 ` Mark McLoughlin
2008-12-04 15:10   ` Anthony Liguori
2008-12-05 17:39 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).