]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: fix uninitialized memory on sockaddr_storage print
authorSage Weil <sage@newdream.net>
Wed, 7 Oct 2009 17:29:13 +0000 (10:29 -0700)
committerSage Weil <sage@newdream.net>
Wed, 7 Oct 2009 17:29:13 +0000 (10:29 -0700)
src/msg/tcp.h

index 0a701a27f874e4ab9c79e53dd28a3f24c4f7269c..e34795667be336a79599db010ba7a0c4151ea5e1 100644 (file)
@@ -14,7 +14,7 @@ using std::ostream;
 
 inline ostream& operator<<(ostream& out, const sockaddr_storage &ss)
 {
-  char buf[NI_MAXHOST];
+  char buf[NI_MAXHOST] = { 0 };
   getnameinfo((struct sockaddr *)&ss, sizeof(ss), buf, sizeof(buf), 0, 0, NI_NUMERICHOST);
   return out << buf;
 }