mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1747264 - Avoid OOMing if the URL of an XML document is huge. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D134506
This commit is contained in:
parent
6303dd77dd
commit
2f2b2fb6fb
@ -688,7 +688,10 @@ nsParser::Parse(nsIURI* aURL, void* aKey) {
|
||||
if (rv != NS_OK) {
|
||||
return rv;
|
||||
}
|
||||
NS_ConvertUTF8toUTF16 theName(spec);
|
||||
nsString theName; // Not nsAutoString due to length and usage
|
||||
if (!CopyUTF8toUTF16(spec, theName, mozilla::fallible)) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
nsScanner* theScanner = new nsScanner(theName, false);
|
||||
CParserContext* pc =
|
||||
|
Loading…
Reference in New Issue
Block a user