Byte order mark in XML content causes a hard crash #65
drmohundro
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It looks like
NSXMLParser
will crash if a byte order mark (BOM) is present in the file/content being parsed. I've been able to reproduce the error and I have a repro committed on the bom-crash branch (see https://github.com/drmohundro/SWXMLHash/blob/bom-crash/Tests/SWXMLHashSpecs.swift#L303-L320).I can think of a few options for handling it:
NSXMLParser
config.stripByteOrderMarkBytes = true
orconfig.stripCrashingCharacters = true
or something like that?I'm open to thoughts or ideas here. I'd also be curious if anyone else has run into this issue before related to the
NSXMLParser
.Beta Was this translation helpful? Give feedback.
All reactions