[ovs-dev] [PATCH] stream: Fix uninitialized values in stream_init().

Ben Pfaff blp at nicira.com
Wed Nov 2 19:59:20 UTC 2011


stream_init() didn't initialize the remote_ip, remote_port, local_ip, or
local_port members of the stream, so "unix" streams that don't have any of
those would get random values instead.

Reported-by: "Voravit T." <voravit at kth.se>
Reported-by: Jari Sundell <sundell.software at gmail.com>
---
 AUTHORS      |    2 ++
 lib/stream.c |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index d19d665..0d4cc95 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -77,6 +77,7 @@ Henrik Amren            henrik at nicira.com
 Jad Naous               jnaous at gmail.com
 Jan Medved              jmedved at juniper.net
 Janis Hamme             janis.hamme at student.kit.edu
+Jari Sundell            sundell.software at gmail.com
 Jed Daniels             openvswitch at jeddaniels.com
 Jeongkeun Lee           jklee at hp.com
 Joan Cirer              joan at ev0.net
@@ -105,6 +106,7 @@ Takayuki HAMA           t-hama at cb.jp.nec.com
 Teemu Koponen           koponen at nicira.com
 Tyler Coumbes           coumbes at gmail.com
 Vishal Swarankar        vishal.swarnkar at gmail.com
+Voravit T.              voravit at kth.se
 YAMAMOTO Takashi        yamamoto at valinux.co.jp
 Yongqiang Liu           liuyq7809 at gmail.com
 kk yap                  yapkke at stanford.edu
diff --git a/lib/stream.c b/lib/stream.c
index 37b6110..8f567ca 100644
--- a/lib/stream.c
+++ b/lib/stream.c
@@ -616,6 +616,7 @@ void
 stream_init(struct stream *stream, struct stream_class *class,
             int connect_status, const char *name)
 {
+    memset(stream, 0, sizeof *stream);
     stream->class = class;
     stream->state = (connect_status == EAGAIN ? SCS_CONNECTING
                     : !connect_status ? SCS_CONNECTED
-- 
1.7.4.4




More information about the dev mailing list