Zero out otherwise uninitialized padding in make_unbuffered_packet_out().
authorBen Pfaff <blp@nicira.com>
Tue, 9 Sep 2008 20:10:09 +0000 (13:10 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 9 Sep 2008 21:12:57 +0000 (14:12 -0700)
Found with valgrind.

lib/vconn.c

index acb35d44c261e2a52fcf3eac6608c60ca4921090..723146ad3e6602fcde8e7ccddc9af274c7272caa 100644 (file)
@@ -552,7 +552,7 @@ make_unbuffered_packet_out(const struct buffer *packet,
     size_t size = sizeof *opo + sizeof opo->actions[0];
     struct buffer *out = buffer_new(size + packet->size);
     opo = buffer_put_uninit(out, size);
-    memset(opo, 0, sizeof *opo);
+    memset(opo, 0, size);
     opo->header.version = OFP_VERSION;
     opo->header.type = OFPT_PACKET_OUT;
     opo->buffer_id = htonl(UINT32_MAX);