Tuesday, December 11, 2012

fixing an HP Fortify bug to do with XmlReader

This was causing a "High" error in an HP Fortify scan.

XmlReader reader = XmlReader.Create(serializationStream);

 
 

I fixed it might this.

XmlReaderSettings xmlReaderSettings = new XmlReaderSettings();
XmlReader reader = XmlReader.Create(serializationStream, xmlReaderSettings);

 
 

I didn't even have to do something of substance like this.

XmlReaderSettings xmlReaderSettings = new XmlReaderSettings();
xmlReaderSettings.DtdProcessing = DtdProcessing.Prohibit;
XmlReader reader = XmlReader.Create(serializationStream, xmlReaderSettings);

No comments:

Post a Comment