From 035a58b8ab2213dfb9eea6698971f1e431845be1 Mon Sep 17 00:00:00 2001 From: Atsushi Eno Date: Tue, 27 Jul 2010 18:29:09 +0900 Subject: [PATCH] 2010-07-27 Atsushi Enomoto * ConfigurationPropertyCollection.cs, PropertyInformation.cs: add null check to detect bogus configuration early. --- mcs/class/System.Configuration/System.Configuration/ChangeLog | 5 +++++ .../System.Configuration/ConfigurationPropertyCollection.cs | 2 ++ .../System.Configuration/System.Configuration/PropertyInformation.cs | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/mcs/class/System.Configuration/System.Configuration/ChangeLog b/mcs/class/System.Configuration/System.Configuration/ChangeLog index 9a3074a73f1..005312a358f 100644 --- a/mcs/class/System.Configuration/System.Configuration/ChangeLog +++ b/mcs/class/System.Configuration/System.Configuration/ChangeLog @@ -1,3 +1,8 @@ +2010-07-27 Atsushi Enomoto + + * ConfigurationPropertyCollection.cs, PropertyInformation.cs: + add null check to detect bogus configuration early. + 2010-01-09 Marek Habersack * ConfigurationLocation.cs: trailing / characters are removed from diff --git a/mcs/class/System.Configuration/System.Configuration/ConfigurationPropertyCollection.cs b/mcs/class/System.Configuration/System.Configuration/ConfigurationPropertyCollection.cs index bbe44f45133..33dba87688b 100644 --- a/mcs/class/System.Configuration/System.Configuration/ConfigurationPropertyCollection.cs +++ b/mcs/class/System.Configuration/System.Configuration/ConfigurationPropertyCollection.cs @@ -66,6 +66,8 @@ namespace System.Configuration public void Add (ConfigurationProperty property) { + if (property == null) + throw new ArgumentNullException ("property"); collection.Add (property); } diff --git a/mcs/class/System.Configuration/System.Configuration/PropertyInformation.cs b/mcs/class/System.Configuration/System.Configuration/PropertyInformation.cs index 9d5662712ad..31cb6348a12 100644 --- a/mcs/class/System.Configuration/System.Configuration/PropertyInformation.cs +++ b/mcs/class/System.Configuration/System.Configuration/PropertyInformation.cs @@ -44,6 +44,10 @@ namespace System.Configuration internal PropertyInformation (ConfigurationElement owner, ConfigurationProperty property) { + if (owner == null) + throw new ArgumentNullException ("owner"); + if (property == null) + throw new ArgumentNullException ("property"); this.owner = owner; this.property = property; } -- 2.11.4.GIT