[Mono-bugs] [Bug 56770][Min] New - Constructor for XmlParserContext doesn't like lots of nulls

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 9 Apr 2004 21:29:17 -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 dave-gnome-bugs@earth.li.

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

--- shadow/56770	2004-04-09 21:29:17.000000000 -0400
+++ shadow/56770.tmp.23339	2004-04-09 21:29:17.000000000 -0400
@@ -0,0 +1,67 @@
+Bug#: 56770
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: Sys.XML
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: dave-gnome-bugs@earth.li               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Constructor for XmlParserContext doesn't like lots of nulls
+
+WiX calls: 
+
+  XmlParserContext context = new XmlParserContext(null, null, null,
+XmlSpace.None);
+
+We don't check nsMgr for being null before using it. So if you pass null
+for nt and nsMgr it will NPE. 
+
+The fact that WiX calls this, (and I have run it on .NET) implies that it
+is supposed to work.
+
+Steps to reproduce the problem:
+1. 
+using System;
+using System.Xml;
+
+class t1
+{
+  static void Main(string [] args ) {
+   XmlParserContext context = new XmlParserContext(null, null, null,
+XmlSpace.None);
+  }
+}
+
+
+Actual Results:
+
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+in [0x0000d] (at
+/home/sheldon/hacking/mono/raw_cvs/mcs/class/System.XML/System.Xml/XmlParserContext.cs:125)
+System.Xml.XmlParserContext:.ctor
+(System.Xml.XmlNameTable,System.Xml.XmlNamespaceManager,Mono.Xml.DTDObjectModel,string,string,System.Xml.XmlSpace,System.Text.Encoding)
+
+
+Expected Results:
+Nicely constructed XmlParserContext.
+
+
+We do: 
+
+if (nt == null)
+   this.nameTable = nsMgr.NameTable;
+else
+    this.NameTable = nt;
+
+
+Which clearly won't work if nt and nsMgr are both null. Unfortunately I am
+not sure what this.nameTable should be set to in that case.