mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1171970. Handle super-long lines in CSS files a bit more gracefully if they cause OOM when creating CSS error messages. r=heycam
This commit is contained in:
parent
0926e0e518
commit
4056495adb
@ -243,7 +243,11 @@ ErrorReporter::AddToError(const nsString &aErrorText)
|
||||
// for all errors on that line. That causes the text of the line to
|
||||
// be shared among all the nsIScriptError objects.
|
||||
if (mErrorLine.IsEmpty() || mErrorLineNumber != mPrevErrorLineNumber) {
|
||||
mErrorLine = mScanner->GetCurrentLine();
|
||||
// Be careful here: the error line might be really long and OOM
|
||||
// when we try to make a copy here. If so, just leave it empty.
|
||||
if (!mErrorLine.Assign(mScanner->GetCurrentLine(), fallible)) {
|
||||
mErrorLine.Truncate();
|
||||
}
|
||||
mPrevErrorLineNumber = mErrorLineNumber;
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user