[Mono-bugs] [Bug 61595][Nor] New - Socket.Select throws NullReferenceException

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 15 Jul 2004 06:33:28 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by dev@6wardlaw.freeserve.co.uk.

http://bugzilla.ximian.com/show_bug.cgi?id=61595

--- shadow/61595	2004-07-15 06:33:28.000000000 -0400
+++ shadow/61595.tmp.4081	2004-07-15 06:33:28.000000000 -0400
@@ -0,0 +1,59 @@
+Bug#: 61595
+Product: Mono: Class Libraries
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: dev@6wardlaw.freeserve.co.uk               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Socket.Select throws NullReferenceException
+
+Description of Problem:
+
+Socket Select will throw a null reference exception if an IList with a 
+count of '0' is passed in for either 'read_list', 'write_list' 
+or 'err_list'.
+
+What happens is this: 
+
+If a list (e.g. read_list) is empty, a null reference is passed into 
+the 'Select_internal' runtime system method for that list. This method 
+will then return a null reference when passing this parameter back out.
+
+There is then no check on the validity of the reference passed out when 
+repopulating the original lists.
+
+
+Steps to reproduce the problem:
+1. Call Socket.Select( ) with 'write_list' set to an IList of length 0;
+
+
+Actual Results:
+
+Unhandled Exception: System.NullReferenceException: Object reference not 
+set to an instance of an object
+in <0x00728> System.Net.Sockets.Socket:Select 
+(System.Collections.IList,System.Collections.IList,System.Collections.ILis
+t,int)
+
+Expected Results:
+
+No exception to be thrown
+
+
+How often does this happen? 
+
+Every Time
+
+
+Additional Information:
+
+Suggest attached change to be made.