[Mono-bugs] [Bug 68956][Wis] New - HttpWebResponse.cs does not work if cookie has trailing ; in values

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 30 Oct 2004 17:13:41 -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 dvandorp@gmail.com.

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

--- shadow/68956	2004-10-30 17:13:41.000000000 -0400
+++ shadow/68956.tmp.21229	2004-10-30 17:13:41.000000000 -0400
@@ -0,0 +1,59 @@
+Bug#: 68956
+Product: Mono: Class Libraries
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: dvandorp@gmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: HttpWebResponse.cs does not work if cookie has trailing ; in values
+
+When processing a Cookie that has a trailing ; it locks up (loops once too
+many times)
+
+
+Steps to reproduce the problem:
+1. Try and parse a site which returns a cookie with a trailing ;
+2. 
+3. 
+
+Actual Results:
+lockup
+
+Expected Results:
+no lockup
+
+How often does this happen? 
+always
+
+
+
+
+Additional Information:
+
+Index: HttpWebResponse.cs
+===================================================================
+RCS file: /mono/mcs/class/System/System.Net/HttpWebResponse.cs,v
+retrieving revision 1.18
+diff -u -r1.18 HttpWebResponse.cs
+--- HttpWebResponse.cs  13 Sep 2004 17:53:56 -0000      1.18
++++ HttpWebResponse.cs  30 Oct 2004 20:34:22 -0000
+@@ -340,6 +340,8 @@
+                                string name_value = name_values [i].Trim ();
+                                string name = GetCookieName (name_value,
+name_value.Length, ref pos);
+                                string value = GetCookieValue (name_value,
+name_value.Length, ref pos);
++                                if (name_value == "")
++                                        continue;
+                                if (cookie == null) {
+                                        cookie = new Cookie (name, value);
+                                        continue;