summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/optinet2.cxx18
1 files changed, 14 insertions, 4 deletions
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 9fad8b6b802b..00dbf792ae57 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -1030,18 +1030,28 @@ bool MozPluginTabPage::installPlugin()
#ifdef UNIX
// get the real file referred by .so lnk file
char* pHome = getpwuid(getuid())->pw_dir;
+ if(!pHome)
+ {
+ return false;
+ }
OString lnkFilePath(OString(pHome) + OString("/.mozilla/plugins/libnpsoplugin" SAL_DLLEXTENSION));
- remove(lnkFilePath.getStr());
+ (void)remove(lnkFilePath.getStr());
// create the dirs if necessary
struct stat buf;
char tmpDir[NPP_PATH_MAX] = {0};
- sprintf(tmpDir, "%s/.mozilla", pHome);
+ snprintf(tmpDir, NPP_PATH_MAX, "%s/.mozilla", pHome);
if (0 > stat(lnkFilePath.getStr(), &buf))
{
- mkdir(tmpDir, 0755);
+ if(mkdir(tmpDir, 0755))
+ {
+ return false;
+ }
strcat(tmpDir, "/plugins");
- mkdir(tmpDir, 0755);
+ if(mkdir(tmpDir, 0755))
+ {
+ return false;
+ }
}
// get the real file path