Fixing bug 366082. Prevent Adobe Acrobat from loading URLs other than http:, https:, or ftp: w/o specifying a target. r+sr+a=dveditz@cruzio.com

git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@219080 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jst%mozilla.org
2007-01-28 19:44:05 +00:00
parent 41da8c38d4
commit 0036bf7da5
3 changed files with 31 additions and 0 deletions

View File

@@ -1120,6 +1120,21 @@ _geturl(NPP npp, const char* relativeURL, const char* target)
("NPN_GetURL: npp=%p, target=%s, url=%s\n", (void *)npp, target,
relativeURL));
// Block Adobe Acrobat from loading URLs that are not http:, https:,
// or ftp: URLs if the given target is null.
if (target == nsnull && relativeURL &&
(strncmp(relativeURL, "http:", 5) != 0) &&
(strncmp(relativeURL, "https:", 6) != 0) &&
(strncmp(relativeURL, "ftp:", 4) != 0)) {
ns4xPluginInstance *inst = (ns4xPluginInstance *) npp->ndata;
const char *name = nsPluginHostImpl::GetPluginName(inst);
if (name && strstr(name, "Adobe") && strstr(name, "Acrobat")) {
return NPERR_NO_ERROR;
}
}
return MakeNew4xStreamInternal (npp, relativeURL, target,
eNPPStreamTypeInternal_Get);
}