-
Notifications
You must be signed in to change notification settings - Fork 5k
XmlTextReader.Read throws ArgumentNullException #1409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Questionable choice of exception for XML to throw on malformed XML. |
This type is actually internal to DCS. |
We should throw a different exception other than ArgumentNullException. However, due to the issue is not reported by real world scenario, this is lower priority issue. |
Simple fix, low priority scenario. |
@imcarolwang is this still on your radar? |
I've checked this one but my "repro" only get part of the exception stack which doesn't throw ArgumentException, it's like below. I've run the repro project targeting .NETCore2.1, 2.2, 3.1, all get the same result.
|
@Metalnem is this still an issue with you? |
@imcarolwang I just pasted this code in and ran it against latest 6.0 bits:
it is not fixed. |
XmlTextReader.Read() is only documented to throw XmlException. Moving to Xml path. |
Tagging subscribers to this area: @dotnet/area-system-xml Issue DetailsDataContractSerializer.ReadObject sometimes throws ArgumentNullException. Here's the full program that reproduces this: using System.IO;
using System.Runtime.Serialization;
using System.Text;
namespace CoreFX.Fuzz
{
public class Program
{
[DataContract]
private class Obj { }
public static void Main(string[] args)
{
var xml = @"<Program.Obj xmlns=""http://schemas.datacontract.org/2004/07/CoreFX.Fuzz""><s:";
var bytes = Encoding.UTF8.GetBytes(xml);
var stream = new MemoryStream(bytes);
var serializer = new DataContractSerializer(typeof(Obj));
serializer.ReadObject(stream);
}
}
} The stack trace:
The environment:
Found via SharpFuzz.
|
@Metalnem do you feel like sending PR with a tiny test? I can help with that if needed |
Merge from dotnet/runtime
@imcarolwang - If this still repros, |
@StephenMolloy, I haven't been able to reproduce this issue, on my repro environment, the stack trace seems missing some details than reported in issue, the exception is |
DataContractSerializer.ReadObject sometimes throws ArgumentNullException. Here's the full program that reproduces this:
The stack trace:
The environment:
Found via SharpFuzz.
The text was updated successfully, but these errors were encountered: