From 0d52c944361871f8b4bc4bb427af861db1d6978d Mon Sep 17 00:00:00 2001 From: "peterlubczynski%netscape.com" Date: Thu, 25 Apr 2002 14:07:46 +0000 Subject: [PATCH] Fixing crash with default plugin, r=av, sr=waterson, bug 139529 git-svn-id: svn://10.0.0.236/trunk@119824 18797224-902f-48f8-a5cc-f745e15eee43 --- .../plugin/samples/default/windows/plugin.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mozilla/modules/plugin/samples/default/windows/plugin.cpp b/mozilla/modules/plugin/samples/default/windows/plugin.cpp index d51eb985062..73b2316ac5f 100644 --- a/mozilla/modules/plugin/samples/default/windows/plugin.cpp +++ b/mozilla/modules/plugin/samples/default/windows/plugin.cpp @@ -392,6 +392,18 @@ LPSTR CPlugin::createURLString() urlToOpen = szPageUrlForJVM; } + // wsprintf doesn't like null pointers on NT or 98, so + // change any null string pointers to null strings + if (!m_szPageURL) { + m_szPageURL = new char[1]; + m_szPageURL[0] = '\0'; + } + + if (!m_szFileURL) { + m_szFileURL = new char[1]; + m_szFileURL[0] = '\0'; + } + m_szURLString = new char[lstrlen(szPluginFinderCommandBeginning) + lstrlen(urlToOpen) + 10 + lstrlen((LPSTR)m_pNPMIMEType) + 13 + lstrlen((LPSTR)m_szPageURL) + 11 +