зеркало из https://github.com/mozilla/pjs.git
Protect against null contexts. bug 340602, r+sr=roc
This commit is contained in:
Родитель
7f74e54994
Коммит
351b267f3b
|
@ -2247,6 +2247,10 @@ IsContextOnStack(nsIJSContextStack *aStack, JSContext *aContext)
|
|||
rv = iterator->Prev(&ctx);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "Broken iterator implementation");
|
||||
|
||||
if (!ctx) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (nsJSUtils::GetDynamicScriptContext(ctx) && ctx == aContext)
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
|
|
@ -88,6 +88,11 @@ GetContextFromStack(nsIJSContextStack *aStack, JSContext **aContext)
|
|||
rv = iterator->Prev(aContext);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "Broken iterator implementation");
|
||||
|
||||
// Consider a null context the end of the line.
|
||||
if (!*aContext) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (nsJSUtils::GetDynamicScriptContext(*aContext)) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче