Permalink
Browse files

2006-04-26 Dick Porter <dick@ximian.com>

        * sockets.c (WSAIoctl): Check the output buffer is valid before
        writing to it.

        * handles.c (_wapi_search_handle): Set shared pointer if we find a
        shared handle that has been already opened.

2006-04-26  Dick Porter  <dick@ximian.com>

        * socket-io.c (hostent_to_IPHostEntry2): Explicitly check for NULL
        dereference.



svn path=/branches/mono-1-1-13/mono/; revision=59931
  • Loading branch information...
1 parent 7b9b621 commit 797397d18e363cc457ab1cb62e535479ca760eb0 @dickp dickp committed Apr 26, 2006
Showing with 29 additions and 2 deletions.
  1. +8 −0 mono/io-layer/ChangeLog
  2. +5 −0 mono/io-layer/handles.c
  3. +7 −1 mono/io-layer/sockets.c
  4. +5 −0 mono/metadata/ChangeLog
  5. +4 −1 mono/metadata/socket-io.c
View
@@ -1,3 +1,11 @@
+2006-04-26 Dick Porter <dick@ximian.com>
+
+ * sockets.c (WSAIoctl): Check the output buffer is valid before
+ writing to it.
+
+ * handles.c (_wapi_search_handle): Set shared pointer if we find a
+ shared handle that has been already opened.
+
2006-04-21 Dick Porter <dick@ximian.com>
* threads.c (GetCurrentThread): Reference the handle if we return
View
@@ -673,6 +673,11 @@ gpointer _wapi_search_handle (WapiHandleType type,
if (check (ret, user_data) == TRUE) {
_wapi_handle_ref (ret);
found = TRUE;
+
+ if (_WAPI_SHARED_HANDLE (type)) {
+ shared = &_wapi_shared_layout->handles[i];
+ }
+
break;
}
}
View
@@ -794,9 +794,15 @@ WSAIoctl (guint32 fd, gint32 command,
} else {
/* We just copy the buffer to the output. Some ioctls
* don't even output any data, but, well...
+ *
+ * NB windows returns WSAEFAULT if o_len is too small
*/
i_len = (i_len > o_len) ? o_len : i_len;
- memcpy (output, buffer, i_len);
+
+ if (i_len > 0 && output != NULL) {
+ memcpy (output, buffer, i_len);
+ }
+
g_free (buffer);
*written = i_len;
}
View
@@ -1,3 +1,8 @@
+2006-04-26 Dick Porter <dick@ximian.com>
+
+ * socket-io.c (hostent_to_IPHostEntry2): Explicitly check for NULL
+ dereference.
+
2006-04-21 Dick Porter <dick@ximian.com>
* threads.c (mono_thread_detach): Fix reference counting when
@@ -2175,7 +2175,8 @@ static gboolean hostent_to_IPHostEntry2(struct hostent *he1,struct hostent *he2,
mono_array_set (*h_aliases, MonoString *, i, alias);
i++;
}
- } else if (family_hint == PF_UNSPEC || family_hint == PF_INET6) {
+ } else if (he2 != NULL && (family_hint == PF_UNSPEC ||
+ family_hint == PF_INET6)) {
*h_name=mono_string_new (domain, he2->h_name);
i=0;
@@ -2193,6 +2194,8 @@ static gboolean hostent_to_IPHostEntry2(struct hostent *he1,struct hostent *he2,
mono_array_set (*h_aliases, MonoString *, i, alias);
i++;
}
+ } else {
+ return(FALSE);
}
/*

0 comments on commit 797397d

Please sign in to comment.