fix some simple crasher bugs

This commit is contained in:
Chris Jones 2009-10-08 00:49:30 -05:00
parent de1fe88060
commit f3992ab813
3 changed files with 20 additions and 4 deletions

View File

@ -187,8 +187,8 @@ PluginModuleParent::NPP_New(NPMIMEType pluginType,
nsTArray<nsCString> values;
for (int i = 0; i < argc; ++i) {
names.AppendElement(nsDependentCString(argn[i]));
values.AppendElement(nsDependentCString(argv[i]));
names.AppendElement(NullableString(argn[i]));
values.AppendElement(NullableString(argv[i]));
}
NPError prv = NPERR_GENERIC_ERROR;

View File

@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim: sw=4 ts=4 et :
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
@ -698,6 +698,8 @@ PluginScriptableObjectChild::AnswerInvoke(const NPRemoteIdentifier& aId,
Variant* aResult,
bool* aSuccess)
{
*aResult = null_t();
if (!mObject) {
NS_WARNING("Calling AnswerInvoke with an invalidated object!");
*aSuccess = false;
@ -757,6 +759,8 @@ PluginScriptableObjectChild::AnswerInvokeDefault(const nsTArray<Variant>& aArgs,
Variant* aResult,
bool* aSuccess)
{
*aResult = null_t();
if (!mObject) {
NS_WARNING("Calling AnswerInvokeDefault with an invalidated object!");
*aSuccess = false;
@ -837,6 +841,8 @@ PluginScriptableObjectChild::AnswerGetProperty(const NPRemoteIdentifier& aId,
Variant* aResult,
bool* aSuccess)
{
*aResult = null_t();
if (!mObject) {
NS_WARNING("Calling AnswerGetProperty with an invalidated object!");
*aSuccess = false;
@ -961,6 +967,8 @@ PluginScriptableObjectChild::AnswerConstruct(const nsTArray<Variant>& aArgs,
Variant* aResult,
bool* aSuccess)
{
*aResult = null_t();
if (!mObject) {
NS_WARNING("Calling AnswerConstruct with an invalidated object!");
*aSuccess = false;

View File

@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim: sw=4 ts=4 et :
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
@ -854,6 +854,8 @@ PluginScriptableObjectParent::AnswerInvoke(const NPRemoteIdentifier& aId,
Variant* aResult,
bool* aSuccess)
{
*aResult = void_t();
if (!mObject) {
NS_WARNING("Calling AnswerInvoke with an invalidated object!");
*aSuccess = false;
@ -934,6 +936,8 @@ PluginScriptableObjectParent::AnswerInvokeDefault(const nsTArray<Variant>& aArgs
Variant* aResult,
bool* aSuccess)
{
*aResult = void_t();
if (!mObject) {
NS_WARNING("Calling AnswerInvoke with an invalidated object!");
*aSuccess = false;
@ -1046,6 +1050,8 @@ PluginScriptableObjectParent::AnswerGetProperty(const NPRemoteIdentifier& aId,
Variant* aResult,
bool* aSuccess)
{
*aResult = void_t();
if (!mObject) {
NS_WARNING("Calling AnswerGetProperty with an invalidated object!");
*aSuccess = false;
@ -1231,6 +1237,8 @@ PluginScriptableObjectParent::AnswerConstruct(const nsTArray<Variant>& aArgs,
Variant* aResult,
bool* aSuccess)
{
*aResult = void_t();
if (!mObject) {
NS_WARNING("Calling AnswerConstruct with an invalidated object!");
*aSuccess = false;