+2006-08-16 Alp Toker <alp@atoker.com>
+
+ * metadata/socket-io.c: First half of the fix for #79084.
+ Set sa_size to the length of the content, not that of the struct.
+ Don't add NULL suffix to the content, this should be done in
+ managed code if needed.
+
2006-08-14 Raja R Harinath <rharinath@novell.com>
Fix part of #79012
if (saddr->sa_family == AF_UNIX) {
/* sa_len includes the entire sockaddr size, so we don't need the
* N bytes (sizeof (unsigned short)) of the family. */
- data=mono_array_new(domain, mono_get_byte_class (), sa_size - 2);
+ data=mono_array_new(domain, mono_get_byte_class (), sa_size);
} else
#endif
{
struct sockaddr_un *sock_un;
int i;
- /* Need a byte for the '\0' terminator, and the first
+ /* Need a byte for the '\0' terminator/prefix, and the first
* two bytes hold the SocketAddress family
*/
if (len - 2 >= MONO_SIZEOF_SUNPATH) {
i + 2);
}
- sock_un->sun_path [len - 2] = '\0';
- *sa_size = sizeof (struct sockaddr_un);
+ *sa_size = len;
return (struct sockaddr *)sock_un;
#endif