From: Ben Pfaff Date: Tue, 9 Sep 2008 20:10:09 +0000 (-0700) Subject: Zero out otherwise uninitialized padding in make_unbuffered_packet_out(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9bf3d9301e2473c034c947b45ee06ab6b5af5877;p=openvswitch Zero out otherwise uninitialized padding in make_unbuffered_packet_out(). Found with valgrind. --- diff --git a/lib/vconn.c b/lib/vconn.c index acb35d44..723146ad 100644 --- a/lib/vconn.c +++ b/lib/vconn.c @@ -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);