You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When parsing an XML file from Data, it appears that libxml2 fails to allocate memory and XMLParser.parse() fails.
This happens then the XMLParser is initialised with larger data:
let xmlParser = XMLParser(data: data)
let parseResult = xmlParser.parse() // returns false and NSXMLParserErrorDomain Code=1 is set
There is a workaround currently to use an input stream:
let inputStream = InputStream(data: data)
let xmlParser = XMLParser(inputStream: data)
let parseResult = xmlParser.parse() // works fine
However, the issue occurs only on Linux and the size of the data required to trigger this isn't unreasonable IMO. I can trigger it with data of around 930,000 bytes.
The text was updated successfully, but these errors were encountered:
When parsing an XML file from
Data
, it appears that libxml2 fails to allocate memory andXMLParser.parse()
fails.This happens then the XMLParser is initialised with larger data:
There is a workaround currently to use an input stream:
However, the issue occurs only on Linux and the size of the data required to trigger this isn't unreasonable IMO. I can trigger it with data of around 930,000 bytes.
The text was updated successfully, but these errors were encountered: