mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-26 23:23:33 +00:00
Bug 793866 - Missing null check in mozInlineSpellChecker::UpdateCurrentDictionary(); r=ehsan
This commit is contained in:
parent
4766ff4681
commit
117e69b7e2
21
editor/libeditor/html/crashtests/793866.html
Normal file
21
editor/libeditor/html/crashtests/793866.html
Normal file
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script>
|
||||
|
||||
function boom()
|
||||
{
|
||||
var b = document.body;
|
||||
b.contentEditable = "true";
|
||||
document.execCommand("contentReadOnly", false, null);
|
||||
b.focus();
|
||||
b.contentEditable = "false";
|
||||
document.documentElement.contentEditable = "true";
|
||||
document.createDocumentFragment().appendChild(b);
|
||||
document.documentElement.focus();
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body onload="boom();"></body>
|
||||
</html>
|
@ -35,3 +35,4 @@ load 766795.html
|
||||
load 767169.html
|
||||
load 769967.xhtml
|
||||
load 768748.html
|
||||
needs-focus load 793866.html
|
||||
|
@ -1780,10 +1780,12 @@ NS_IMETHODIMP mozInlineSpellChecker::UpdateCurrentDictionary()
|
||||
previousDictionary.Truncate();
|
||||
}
|
||||
|
||||
// This might set mSpellCheck to null (bug 793866)
|
||||
nsresult rv = mSpellCheck->UpdateCurrentDictionary();
|
||||
|
||||
nsAutoString currentDictionary;
|
||||
if (NS_FAILED(mSpellCheck->GetCurrentDictionary(currentDictionary))) {
|
||||
if (!mSpellCheck ||
|
||||
NS_FAILED(mSpellCheck->GetCurrentDictionary(currentDictionary))) {
|
||||
currentDictionary.Truncate();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user