diff options
Diffstat (limited to 'mcs/class')
-rw-r--r-- | mcs/class/Mono.Posix/Mono.Posix/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/Mono.Posix/Mono.Posix/UnixEndPoint.cs | 13 |
2 files changed, 17 insertions, 1 deletions
diff --git a/mcs/class/Mono.Posix/Mono.Posix/ChangeLog b/mcs/class/Mono.Posix/Mono.Posix/ChangeLog index 3a06f8b4432..3db0296ec37 100644 --- a/mcs/class/Mono.Posix/Mono.Posix/ChangeLog +++ b/mcs/class/Mono.Posix/Mono.Posix/ChangeLog @@ -1,3 +1,8 @@ +2005-02-22 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * UnixEndPoint.cs: get the correct bytes when building the filename from + a SocketAddress. Fixes bug #72850. + 2004-12-30 Jonathan Pryor <jonpryor@vt.edu> * Syscall.cs: Add [Obsolete] to Syscall, letting users know they should diff --git a/mcs/class/Mono.Posix/Mono.Posix/UnixEndPoint.cs b/mcs/class/Mono.Posix/Mono.Posix/UnixEndPoint.cs index ecdd01a5822..6d811c84da4 100644 --- a/mcs/class/Mono.Posix/Mono.Posix/UnixEndPoint.cs +++ b/mcs/class/Mono.Posix/Mono.Posix/UnixEndPoint.cs @@ -61,7 +61,18 @@ namespace Mono.Posix { int size = socketAddress.Size; byte [] bytes = new byte [size]; - for (int i = 0; i < size; i++) { + /* + * Should also check this + * + int addr = (int) AddressFamily.Unix; + if (socketAddress [0] != (addr & 0xFF)) + throw new ArgumentException ("socketAddress is not a unix socket address."); + + if (socketAddress [1] != ((addr & 0xFF00) >> 8)) + throw new ArgumentException ("socketAddress is not a unix socket address."); + */ + + for (int i = 2; i < size - 2; i++) { bytes [i] = socketAddress [i]; } |