bugDotGNU Portable.NET - Bugs: bug #2498, NameValueCollection's Get method...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #2498: NameValueCollection's Get method fails with null name

Submitted by:  Marcus Urban <mathpup>
Submitted on:  Sat 08 Feb 2003 09:30:07 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Mon 10 Feb 2003 09:28:22 AM UTC, comment #1:

Patch applied to fix - 10 Feb 2003.

Rhys Weatherley <rweather>
Project Administrator
Sat 08 Feb 2003 09:30:07 AM UTC, original submission:

The ECMA spec specifically allows the name in (name, value) pairs of a NameValueCollection to be null. Storing the null names works, but retrieving them fails because CollapseToString( ArrayList strings) does not check if strings is null before attempting to access the Count property, causing an exception:

Uncaught exception: System.NullReferenceException: The value 'null' was found where an instance of an object was required
at System.Collections.Specialized.NameValueCollection.CollapseToString(ArrayList) in ./Collections/Specialized/NameValueCollection.cs:159
at System.Collections.Specialized.NameValueCollection.Get(String) in ./Collections/Specialized/NameValueCollection.cs:207
at System.Collections.Specialized.NameValueCollection.get_Item(String) in ./Collections/Specialized/NameValueCollection.cs:272
at Testing.Main()

Note that CollapseToArray( ArrayList strings) does check whether strings is null.

I am submitted a patch for this bug.

Marcus Urban <mathpup>

 

Attached Files
file #285:  namevalue.cs added by mathpup (245B - text/x-csharp - Test case)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Mon 10 Feb 2003 09:28:22 AM UTCrweatherOpen/ClosedOpen=>(Error - Not Found)
Mon 10 Feb 2003 09:28:21 AM UTCrweatherStatusNone=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1