[Mono-bugs] [Bug 75949][Nor] New - bug + solution

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Aug 31 16:56:22 EDT 2005


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 sasham at univ.kiev.ua.

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

--- shadow/75949	2005-08-31 16:56:22.000000000 -0400
+++ shadow/75949.tmp.30311	2005-08-31 16:56:22.000000000 -0400
@@ -0,0 +1,86 @@
+Bug#: 75949
+Product: Mono: Class Libraries
+Version: 1.1
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: sasham at univ.kiev.ua               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: bug + solution
+
+Message:
+
+--------------------------------------------------------------------------------
+Unhandled Exception: System.Net.WebException: Array index is out of range. ---> 
+System.IndexOutOfRangeException: Array index is out of range.
+in <0x00047> System.Net.CookieParser:GetNextNameValue (System.String name, 
+System.String val)
+in <0x00583> System.Net.HttpWebResponse:SetCookie (System.String header)
+in (wrapper remoting-invoke-with-check) System.Net.HttpWebResponse:SetCookie 
+(string)
+in <0x0009a> System.Net.HttpWebResponse:FillCookies ()
+in (wrapper remoting-invoke-with-check) System.Net.HttpWebResponse:FillCookies 
+()
+in <0x0005f> System.Net.HttpWebResponse:.ctor (System.Uri uri, System.String 
+method, System.Net.WebConnectionData data, System.Net.CookieContainer 
+container)
+in (wrapper remoting-invoke-with-check) System.Net.HttpWebResponse:.ctor 
+(System.Uri,string,System.Net.WebConnectionData,System.Net.CookieContainer)
+in <0x0009a> System.Net.HttpWebRequest:SetResponseData (System.Net.
+WebConnectionData data)--- End of inner exception stack trace ---
+
+in <0x00102> System.Net.HttpWebRequest:EndGetResponse (IAsyncResult 
+asyncResult)
+in <0x00047> System.Net.HttpWebRequest:GetResponse ()
+blah, blah, blah.......
+--------------------------------------------------------------------------------
+
+Reason: 
+webHeaders.GetValues ("Set-Cookie") has the following cookie header: 
+"a=b; .....; secure", note: " secure" attribute at the End!
+
+My solution: (just add marked line to the source)
+
+ // mono : 1.1.8.3
+ // file : "mono-1.1.8.3/mcs/class/System/System.Net/HttpWebResponse.cs"
+ // class: CookieParser
+ // line : 442
+
+/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
+public bool GetNextNameValue (out string name, out string val)
+{
+name = null;
+val = null;
+
+if (pos >= length)
+return false;
+
+name = GetCookieName ();
+
+if( pos < length )//+//if header=="a=b; .....; secure"=>IndexOutOfRange:(BUG!
+if (header [pos] == '=') {
+pos++;
+val = GetCookieValue ();
+if (pos < length && header [pos] == ';')
+pos++;
+}
+
+return true;
+}
+/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
+
+changed code works fine for me. i suggest you consider including this change to 
+your code.
+
+ps: sorry for "non-standard" way of explaining the problem.
+
+Bests,
+ Oleksandr Motsak


More information about the mono-bugs mailing list