Bug 557209. Initialize 'name' so we don't use it unintialized if GetPluginName fails. r=joshmoz
authorJulian Seward <jseward@acm.org>
Fri, 23 Apr 2010 14:55:22 +1200
changeset 41187 8432af71c6852ba54027cea9dd29904bac5c0a72
parent 41186 b6f9d648a2427642fb0ac639b761e5f18de96a4b
child 41188 ae968e2a47926065da0ea32d302119fc91fc4eae
push idunknown
push userunknown
push dateunknown
reviewersjoshmoz
bugs557209
milestone1.9.3a5pre
Bug 557209. Initialize 'name' so we don't use it unintialized if GetPluginName fails. r=joshmoz
modules/plugin/base/src/nsNPAPIPlugin.cpp
--- a/modules/plugin/base/src/nsNPAPIPlugin.cpp
+++ b/modules/plugin/base/src/nsNPAPIPlugin.cpp
@@ -909,17 +909,17 @@ NPError NP_CALLBACK
   // or ftp: URLs if the given target is null.
   if (!target && relativeURL &&
       (strncmp(relativeURL, "http:", 5) != 0) &&
       (strncmp(relativeURL, "https:", 6) != 0) &&
       (strncmp(relativeURL, "ftp:", 4) != 0)) {
     nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *) npp->ndata;
 
     
-    const char *name;
+    const char *name = nsnull;
     nsRefPtr<nsPluginHost> host = dont_AddRef(nsPluginHost::GetInst());
     host->GetPluginName(inst, &name);
 
     if (name && strstr(name, "Adobe") && strstr(name, "Acrobat")) {
       return NPERR_NO_ERROR;
     }
   }