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 20:09:37 +0000 (13:09 -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 4c24be1..6713ad9 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -71,6 +71,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
@@ -98,6 +99,7 @@ Stephen Hemminger       shemminger@vyatta.com
 Takayuki HAMA           t-hama@cb.jp.nec.com
 Teemu Koponen           koponen@nicira.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 37b6110..8f567ca 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