зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1831654 - Graceful failures for out of range column number in expat error handling r=glandium,peterv
Differential Revision: https://phabricator.services.mozilla.com/D177311
This commit is contained in:
Родитель
be98633762
Коммит
45b7084872
|
@ -973,9 +973,12 @@ static nsresult AppendErrorPointer(tainted_expat<XML_Size> aColNumber,
|
|||
"Unexpected value of column");
|
||||
|
||||
// Last character will be '^'.
|
||||
XML_Size last = (aColNumber - 1).copy_and_verify([&](XML_Size val) {
|
||||
MOZ_RELEASE_ASSERT(val <= aSourceLineLength,
|
||||
"Unexpected value of last column");
|
||||
XML_Size last =
|
||||
(aColNumber - 1).copy_and_verify([&](XML_Size val) -> XML_Size {
|
||||
if (val > aSourceLineLength) {
|
||||
// Unexpected value of last column, just return a safe value
|
||||
return 0;
|
||||
}
|
||||
return val;
|
||||
});
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче