From 8a1c7f57130e868c757a161460b282041034273f Mon Sep 17 00:00:00 2001 From: "timeless%mozdev.org" Date: Sun, 30 Mar 2008 14:26:43 +0000 Subject: [PATCH] Bug 425398 passed 0 identifier [@ NS_ConvertUTF8toUTF16 - doGetIdentifier - _getstringidentifier] r=jst sr=jst a=beltzner git-svn-id: svn://10.0.0.236/trunk@248863 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/modules/plugin/base/src/ns4xPlugin.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/mozilla/modules/plugin/base/src/ns4xPlugin.cpp b/mozilla/modules/plugin/base/src/ns4xPlugin.cpp index 261eb602ced..a33c2d95662 100644 --- a/mozilla/modules/plugin/base/src/ns4xPlugin.cpp +++ b/mozilla/modules/plugin/base/src/ns4xPlugin.cpp @@ -1471,7 +1471,7 @@ doGetIdentifier(JSContext *cx, const NPUTF8* name) utf16name.Length()); if (!str) - return nsnull; + return NULL; return (NPIdentifier)STRING_TO_JSVAL(str); } @@ -1479,6 +1479,11 @@ doGetIdentifier(JSContext *cx, const NPUTF8* name) NPIdentifier NP_CALLBACK _getstringidentifier(const NPUTF8* name) { + if (!name) { + NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_getstringidentifier: passed null name")); + return NULL; + } + nsCOMPtr stack = do_GetService("@mozilla.org/js/xpc/ContextStack;1"); if (!stack) @@ -1510,7 +1515,13 @@ _getstringidentifiers(const NPUTF8** names, int32_t nameCount, JSAutoRequest ar(cx); for (int32_t i = 0; i < nameCount; ++i) { - identifiers[i] = doGetIdentifier(cx, names[i]); + if (names[i]) { + identifiers[i] = doGetIdentifier(cx, names[i]); + } else { + NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_getstringidentifiers: passed null nam +e")); + identifiers[i] = NULL; + } } }