Skip to content
Snippets Groups Projects
Commit 45b70848 authored by Shravan Narayan's avatar Shravan Narayan
Browse files

Bug 1831654 - Graceful failures for out of range column number in expat error...

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
parent be986337
No related branches found
No related tags found
No related merge requests found
......@@ -973,11 +973,14 @@ 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");
return val;
});
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;
});
XML_Size i;
uint32_t minuses = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment