Log profiler: ensure the size we pass to getsockname is initalized correctly.
authorRolf Bjarne Kvinge <rolf@xamarin.com>
Wed, 26 Oct 2011 11:17:40 +0000 (13:17 +0200)
committerRolf Bjarne Kvinge <rolf@xamarin.com>
Wed, 26 Oct 2011 13:37:35 +0000 (15:37 +0200)
mono/profiler/proflog.c

index d4bdab1343b0bf0ac407dd1e7aff6a50e57e4d98..10f989870bcd608af48f7fe8acb45814ef1b2992 100644 (file)
@@ -1952,6 +1952,7 @@ start_helper_thread (MonoProfiler* prof)
                close (prof->server_socket);
                return 0;
        }
+       slen = sizeof (server_address);
        if (getsockname (prof->server_socket, (struct sockaddr *)&server_address, &slen) == 0) {
                prof->command_port = ntohs (server_address.sin_port);
                /*fprintf (stderr, "Assigned server port: %d\n", prof->command_port);*/