[Mono-bugs] [Bug 615499] New: Rss20ItemFormatter.ReadTextSyndicationContent should catch "invalid XML data" exception

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Jun 18 12:42:43 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=615499

http://bugzilla.novell.com/show_bug.cgi?id=615499#c0


           Summary: Rss20ItemFormatter.ReadTextSyndicationContent should
                    catch "invalid XML data" exception
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: WCF
        AssignedTo: atsushi at ximian.com
        ReportedBy: carlos at cmartin.tk
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=370138)
 --> (http://bugzilla.novell.com/attachment.cgi?id=370138)
An RSS feed with invalid XML data

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.4
(KHTML, like Gecko) Chrome/5.0.375.70 Safari/533.4

If the RSS20 feed contains invalid data (as does, ironically enough, the
monologue feed in a couple of posts), the System.Xml.XmlStreamReader.Read()
function called (eventually) by reader.ReadElementContentAsString() throws an
exception which is propagated all the way to the application using the library,
which means that all of the feed has to be discarded.
It would be better if only the data in the post were discarded and the rest of
the feed could be used as usual.

Reproducible: Always

Steps to Reproduce:
Load an RSS20 feed with invalid XML data
Actual Results:  
An XmlException is propagated all the way to the application

Expected Results:  
The item with invalid data should be discarded (or maybe even only the part
with the invalid data) and the rest of the feed should be read as normal (as
long as it's possible)

This is the stack trace, just for completeness:

Unhandled Exception: System.Xml.XmlException: invalid data.
  at System.Xml.XmlStreamReader.Read (System.Char[] dest_buffer, Int32 index,
Int32 count) [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.ReadTextReader (Int32 remained) [0x00000] in
<filename unknown>:0 
  at Mono.Xml2.XmlTextReader.PeekChar () [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.ReadContent () [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.Read () [0x00000] in <filename unknown>:0 
  at System.Xml.XmlTextReader.Read () [0x00000] in <filename unknown>:0 
  at System.Xml.XmlReader.MoveToContent () [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Syndication.SyndicationVersions.DetectVersion
(System.Xml.XmlReader reader, ReaderKind kind) [0x00000] in <filename
unknown>:0 
  at
System.ServiceModel.Syndication.SyndicationVersions.LoadFeed[SyndicationFeed]
(System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Syndication.SyndicationFeed.Load[SyndicationFeed]
(System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Syndication.SyndicationFeed.Load (System.Xml.XmlReader
reader) [0x00000] in <filename unknown>:0 
  at mcs.WCFTest.Main (System.String[] argv) [0x00000] in <filename unknown>:0

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list