stream: Fix uninitialized values in stream_init().
authorBen Pfaff <blp@nicira.com>
Wed, 2 Nov 2011 19:59:06 +0000 (12:59 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 2 Nov 2011 19:59:06 +0000 (12:59 -0700)
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@kth.se>
Reported-by: Jari Sundell <sundell.software@gmail.com>
AUTHORS
lib/stream.c

diff --git a/AUTHORS b/AUTHORS
index d19d665706bf202286e8d794c6d4c29cffbe72bb..0d4cc959bb0b9b6cf13fe2399d7016978c644e6b 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -77,6 +77,7 @@ Henrik Amren            henrik@nicira.com
 Jad Naous               jnaous@gmail.com
 Jan Medved              jmedved@juniper.net
 Janis Hamme             janis.hamme@student.kit.edu
+Jari Sundell            sundell.software@gmail.com
 Jed Daniels             openvswitch@jeddaniels.com
 Jeongkeun Lee           jklee@hp.com
 Joan Cirer              joan@ev0.net
@@ -105,6 +106,7 @@ Takayuki HAMA           t-hama@cb.jp.nec.com
 Teemu Koponen           koponen@nicira.com
 Tyler Coumbes           coumbes@gmail.com
 Vishal Swarankar        vishal.swarnkar@gmail.com
+Voravit T.              voravit@kth.se
 YAMAMOTO Takashi        yamamoto@valinux.co.jp
 Yongqiang Liu           liuyq7809@gmail.com
 kk yap                  yapkke@stanford.edu
index 37b611000ee9a64698a54bc302d30fca4369ffa7..8f567ca38738b7e60a862594c419c213a0ca39fd 100644 (file)
@@ -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